Django虚拟环境创建问题virtualenvwrapper.sh: There was a problem running the initialization hooks.

virtualenvwrapper.sh: There was a problem running the initialization hooks.

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= and that PATH is set properly.错误
1、在ubuntu中安装虚拟环境时,刷新.basnrc时出现上述错误。

 

 

这是因为ubuntu安装了只有3.x版本的python,在安装时使用的是sudo pip3 install
virtualenvwrapper在我运行的时候默认使用的是python2.x,但在python2.x中不存在对应的模块。

2、修改virtualenvwrapper.sh文件,将框内的python改为python3。

sudo gedit /usr/local/bin/virtualenvwrapper.sh

改成python3

 

 

 

3、重新刷新家目录下的.bashrc。

source .bashrc

4、成功解决。

 

posted @ 2020-07-04 02:19  sewen  Views(406)  Comments(0Edit  收藏  举报