为什么每次打开终端时都会收到此警告/错误消息?应如何解决?

时间:2018-08-30 06:19:26

标签: python-3.x virtualenv virtualenvwrapper

-bash:/ usr / local / bin / python3:没有这样的文件或目录 virtualenvwrapper.sh:运行初始化挂钩时出现问题。

如果Python无法导入模块virtualenvwrapper.hook_loader, 检查是否已安装virtualenvwrapper VIRTUALENVWRAPPER_PYTHON = / usr / local / bin / python3并且该PATH是 设置正确。

2 个答案:

答案 0 :(得分:0)

错误来自import 'zone.js'; import 'zone.js/dist/long-stack-trace-zone.js'; 的错误安装。看来您已经使用virtualenvwrapper安装了virtualenvwrapper,但后来删除了该python。

错误来自/usr/local/bin/python3。编辑它,搜索诸如~/.bashrcsource virtualenvwrapper_lazy.sh之类的内容,然后注释掉或删除该行。

答案 1 :(得分:0)

1. Check virtualenvwrapper is installed.
2. Open your .bashrc file.
3. Run the below commands:
  

export WORKON_HOME = $ HOME / .virtualenv

     

源/usr/local/bin/virtualenvwrapper.sh

workon <virtual_env_name_of_your_choice>
     

哪个python

4. Check the python version.
5. If you want to change the python of your virtualenv, then follow the steps below:
  

vi .bashrc或vi .zshrc

     

别名python = python3

6. Open a new terminal. 
  

哪个python

     

工作

     

哪个python

所有设置都默认将virtualenv设置为python3。

相关问题