Python module not found in virtualenv

前端 未结 2 440
感动是毒
感动是毒 2021-01-03 11:45

I\'ve tried to install a python module:

virtualenv .
source bin/activate
pip install utmp

It seems to be installed:

(wtmp)c         


        
相关标签:
2条回答
  • 2021-01-03 12:10

    Just bumped into the same issue. I found out what is wrong by using which python. It showed me that I actually have an alias in place which points to a different python executable than the one in current virtualenv. Apparently aliases are more important than paths set via source.

    0 讨论(0)
  • 2021-01-03 12:23

    You can check whether it is installed in your virualenv by calling pip list or pip show utmp.

    If not, try to reinstall it:

    pip install --upgrade --no-deps --force-reinstall utmp

    and extend your question with the error log.

    Also verify the shebang line as it might point not to your virtualenv.

    0 讨论(0)
提交回复
热议问题