How to add virtualenv to path

前端 未结 9 918
无人及你
无人及你 2020-12-09 04:01

I am trying to find out why my virtualenv and/or virtualenv wrapper - installed using pip using homebrew - cannot be foun

相关标签:
9条回答
  • 2020-12-09 04:35

    In your .bashrc you need to have:

    export WORKON_HOME=~/.virtualenvs
    source /usr/local/bin/virtualenvwrapper.sh
    
    0 讨论(0)
  • 2020-12-09 04:41

    This solution will give you an alternate tool to use and solve your virtualenv problem at the same time.

    Use pythonbrew. It is inspired from rvm in the ruby world and is helpful in managing pythons on your system and also wrap virtualenv commands to provide virtual environment management. I use it Mountain Lion for my development purposes and have had no problems. More details (on my blog): http://stacktoheap.com/blog/2013/03/11/why-use-virtualenv-when-there-is-pythonbrew/

    0 讨论(0)
  • 2020-12-09 04:44

    (Mac / Linux specific) So I got an error message when I did a pip3 install --user --upgrade virtualenv telling me that I did not have Users/home/Library/Python/3.7/bin in my PATH. So I simply added it.

    If this is on the Mac, the following did it for me

    vi ~/.bash_profile
    
    
    
    PATH="/Users/home/Library/Python/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
    

    restart your terminal and type virtualenv env and that should do it.

    0 讨论(0)
  • 2020-12-09 04:49

    For those with Python 2.7, I came across this as well, and solved it by simply putting the following line into the \etc\paths file (may need to $ sudo chmod it first):

    /Library/Frameworks/Python.framework/Versions/2.7/bin
    

    Save the change and start a new Terminal session. Check it with echo $PATH

    0 讨论(0)
  • 2020-12-09 04:51

    Had the same issue after pip install virtualenv

    When I inspected python ls -la /usr/local/bin/python I found it was symbolically linked to /Library/Frameworks/Python.framework/Versions/2.7/bin/python

    When I cd in that directory I also found the virtualenv executable and

    Fixed it by

    1. cd /Library/Frameworks/Python.framework/Versions/2.7/bin
    2. ln virtualenv /usr/local/bin/virtualenv

    Sidenote: I also happen to have a python installation in /System/Library/Frameworks/Python.framework/Versions/2.7/bin

    I believe that's the one that came with OSX

    0 讨论(0)
  • 2020-12-09 04:51

    The module in /usr/local/lib/python2.7/site-packages is imported by a short script that uses pkg_resources.load_entry_point to run the application. The utility script should be in /usr/local/bin.

    0 讨论(0)
提交回复
热议问题