Where is virtualenvwrapper.sh after pip install?

后端 未结 24 1549
忘了有多久
忘了有多久 2020-12-07 09:20

I\'m trying to setup virtualenvwrapper on OSX, and all the instructions and tutorials I\'ve found tell me to add a source command to .profile, pointing towards virtualenvwra

24条回答
  •  时光取名叫无心
    2020-12-07 10:12

    pip will not try to make things difficult for you on purpose.

    The thing is commands based files are always installed in /bin folders they can be anywhere on the system path.

    I had the same problem and I found that I have these files in my

    ~/.local/bin/

    folder instead of

    /usr/loca/bin/

    which is the common case, but I think they changed the default path to

    ~ or $HOME

    directory because its more isolate for the pip installations and provides a distinction between apt-get packages and pip packages.

    So coming to the point you have two choices here either you go to your .bashrc and make changes like this

    # for virtualenv wrapper
    export WORKON_HOME=$HOME/Envs
    export PROJECT_HOME=$HOME/Devel
    source $HOME/.local/bin/virtualenvwrapper.sh
    

    and than create a directory virtualenvwrapper under /usr/share/ and than symlink your virtualwrapper_lazy.sh like this

    sudo ln -s ~/.local/bin/virtualenvwrapper_lazy.sh /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
    

    and you can check if your workon command is working which will list your existing virtualenv's.

提交回复
热议问题