当前位置: 代码迷 >> 综合 >> mac 报错Error while finding module specification for ‘virtualenvwrapper.hook_loader‘
  详细解决方案

mac 报错Error while finding module specification for ‘virtualenvwrapper.hook_loader‘

热度:0   发布时间:2024-03-07 05:48:47.0

mac 下安装虚拟环境时报错

报错

~ % source .bash_profile
/usr/local/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=/usr/local/bin/python3 and that PATH is
set properly.

解决

~ % pip3 install virtualenvwrapper --upgrade

注意:
pip 版本应和python版本对应

结果

~ % source .bash_profile
~ % mkvirtualenv projAENV
created virtual environment CPython3.8.5.final.0-64 in 1568ms creator CPython3Posix(dest=/Users/Rachel1900/.virtualenvs/projAENV, clear=False, global=False)seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/Rachel1900/Library/Application Support/virtualenv)added seed packages: pip==20.2.3, setuptools==50.3.1, wheel==0.35.1activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
virtualenvwrapper.user_scripts creating /Users/Rachel1900/.virtualenvs/projAENV/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/Rachel1900/.virtualenvs/projAENV/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/Rachel1900/.virtualenvs/projAENV/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/Rachel1900/.virtualenvs/projAENV/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/Rachel1900/.virtualenvs/projAENV/bin/get_env_details

问题解决参考

  相关解决方案