我在python和导入错误方面有一些问题。 每当我打开终端时,在输入任何命令之前我都会得到以下信息:
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3:
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=/Library/Frameworks/
Python.framework/Versions/3.6/bin/python3 and that PATH is
set properly.
当我在终端中输入python
时,也会出现此错误:
ImportError: No module named site
我不知道为什么,但是每次我想使用pip
安装软件包时都会得到此提示
答案 0 :(得分:0)
这归结为向后兼容,您可能只需输入以下内容即可更新〜/ .bashrc:
nano ~/.bashrc
更改
导出VIRTUALENVWRAPPER_PYTHON = / usr / bin / python3
到
导出VIRTUALENVWRAPPER_PYTHON = / usr / bin / python
这很可能会解决您的问题。