mkvirtualenv:找不到命令以及如何知道virtualenvwrapper是否安装正确

时间:2016-09-04 07:58:01

标签: python virtualenvwrapper

我对Linux,python和这个问题的一切都很新。我用pip安装了virtualenvwrapper,我得到了这个:

Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): stevedore in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): pbr>=1.6 in /usr/local/lib/python2.7/dist-packages (from stevedore->virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in /usr/lib/python2.7/dist-packages (from stevedore->virtualenvwrapper)

我将下一行添加到我的bashrc文件

export WORKON_HOME=~/virtualenvs
export VIRTUALENVWRAPPER_HOOK_DIR=$WORKON_HOME/hooks
source /usr/local/bin/virtualenvwrapper.sh

编辑完成后,我重新启动终端并尝试用mkvirtual env创建我的虚拟环境,但是我收到了这个错误:

mkvirtualenv:找不到命令

寻找我读到的答案我应该运行哪个virtualenvwrapper命令来知道它的安装位置。我做到了,但我一无所获。

拜托,你能帮助我吗?我不能继续,我真的需要这样做。

我发现的答案只说明了我必须添加到bashrc文件中的行以解决问题。

先谢谢

1 个答案:

答案 0 :(得分:0)

尝试一下: 在“〜/ .bashrc”的末尾添加以下语句,以修改默认的python并配置virtualenv:

VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=~/.environments
source /usr/local/bin/virtualenvwrapper.sh 

然后使用以下命令重新加载该配置文件:

source ~/.bashrc