我的操作系统(Arch Linux)最近将Python从3.5.2升级到3.6.0,现在在运行任何终端时,我收到此消息:
/usr/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
此外,我得到了这些输出
$ whereis python
python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3.6-config /usr/bin/python3.6m-config /usr/bin/python2.7-config /usr/bin/python /usr/bin/python2.7 /usr/lib/python3.6 /usr/lib/python3.5 /usr/lib/python2.7 /usr/include/python3.6m /usr/include/python2.7 /usr/share/man/man1/python.1.gz
$ which python
/usr/bin/python
$ python --version
Python 3.6.0
我该如何解决这种情况?这种情况会对我创建的虚拟环境或其他程序产生影响吗?
提前致谢。
答案 0 :(得分:4)
这个article对于解决这种情况非常有用,只需要运行:
$ sudo pip3.6 install -U pip
$ sudo pip3.6 install -U virtualenvwrapper