Can't find virtualenv in path even though its there

↘锁芯ラ 提交于 2021-02-08 07:25:40

问题


I'm trying to set up Django. I have Python 3.6 installed, and I installed virtualenvwrapper using pip3.

Here is what my bash profile looks like:

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenv"

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
export PROJECT_HOME=$HOME/Devel
source /Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenvwrapper.sh

Every time I run

$ mkvirtualenv my_django_env

I get

ERROR: virtualenvwrapper could not find virtualenv in your path

回答1:


Note: This answer should have been posted here as it is more relevant to this question.

I cannot tell you how stable solution this is going to be for others. What worked for me is adding Lazy Loading which is described as an alternative initialization script. The error I was getting is that

mkvirtualenv is not in your PATH

when I tried to fire up a virtual env. Adding below script to my .zshrc file helped.

VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh source /usr/local/bin/virtualenvwrapper_lazy.sh

Please also check this out for the whole process of installing and creating virtualenv and virtualenvwrapper pacakages.



来源:https://stackoverflow.com/questions/48630276/cant-find-virtualenv-in-path-even-though-its-there

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!