mkvirtualenv:找不到命令,以及如何知道virtualenvwrapper是否正确安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mkvirtualenv:找不到命令,以及如何知道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文件中以解决问题的行。
非常感谢
答案
Lazy Loading,它被描述为替代初始化脚本。我得到的错误是mkvirtualenv
不在您的PATH
当我尝试启动虚拟环境时。将以下脚本添加到我的.zshrc
文件中很有帮助。
VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh
source /usr/local/bin/virtualenvwrapper_lazy.sh
以上是关于mkvirtualenv:找不到命令,以及如何知道virtualenvwrapper是否正确安装的主要内容,如果未能解决你的问题,请参考以下文章