我在~/.bashrc里面写了export WORKON_HOME=$HOME/.virtualenvs 和 source /usr/local/bin/virtualenvwrapper.sh 但是,每次source ~/.bashrc,都会报错:bash: /home/zhaoyang/anaconda/bin/python: 没有那个文件或目录
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=/home/zhaoyang/anaconda/bin/python and that PATH is
set properly.
可是,奇怪的是,虽然报错了,但是虚拟环境已经可以用了,workon 指令也能用了,创建出来的虚拟环境也在指定的目录下。但每次workon 虚拟环境名,都会报这样的错误:bash: /home/zhaoyang/anaconda/bin/python: 没有那个文件或目录
bash: /home/zhaoyang/anaconda/bin/python: 没有那个文件或目录
bash: /home/zhaoyang/anaconda/bin/python: 没有那个文件或目录
bash: /home/zhaoyang/anaconda/bin/python: 没有那个文件或目录
大神们!我该怎么办,虽然我不是处女座,但真心不想凑活!不想计算机老报错了。谢谢!
错误原因:
Ubuntu安装了2.7和3.x两个版本的python,在安装时使用的是sudo pip3 install virtualenvwrapper
在我运行的时候默认使用的是python2.x,但在python2.x中不存在对应的模块。
(virtualenvwrapper.sh文件内容如下:):
if [ "$VIRTUALENVWRAPPER_PYTHON" = "" ] then
VIRTUALENVWRAPPER_PYTHON="$(command \which python)"
fi
解决方法:修改virtualenvwrapper.sh文件
1.which virtualenvwrapper.sh找到文件路径
2.在文件路径下sudo vim virtualenvwrapper.sh
3.修改:
if [ "$VIRTUALENVWRAPPER_PYTHON" = "" ] then
VIRTUALENVWRAPPER_PYTHON="$(command \which python3)"
fi
解决
http://blog.java1234.com/blog/articles/290.html
VMware虚拟机安装
路径指示错误,应该先到这个路径下检查一下有没对应的文件,如果没有你就该更改正确的目录了,我就这么弄好的。
https://jingyan.baidu.com/article/fd8044faca4cd75031137ac8.html
找不到就下载一个吗!!!我也是醉咯