ERROR: virtualenvwrapper could not find virtualenv in your path

后端 未结 12 1891
广开言路
广开言路 2021-02-01 01:06

I\'m trying to create a virtualenv with virtualenvwrapper, but when I use mkvirtualenv I get the following :

ERROR: virtualenvwrapper c         


        
相关标签:
12条回答
  • 2021-02-01 01:34

    I had this same issues and tried many many things, what found as a solution is i had three pip version, pip with 2.7, 3.6 and 3.7. and 3.6 was the one works fine for many things, and install as sudo pip3.6 install virtualenv, and it works fine. I would suggest, check your pip version and tried to install based on your pip ver.

    0 讨论(0)
  • 2021-02-01 01:34

    I have set the variable VIRTUALENVWRAPPER_VIRTUALENV in my .zshrc to the full path of the virtualenv binary and it works for me.

    Here is my .zshrc file:

    export WORKON_HOME=$HOME/.virtualenvs
    export PROJECT_HOME=$HOME/Devel
    export VIRTUALENVWRAPPER_VIRTUALENV=$HOME/Library/Python/2.7/bin/virtualenv
    source $HOME/Library/Python/2.7/bin/virtualenvwrapper.sh
    
    0 讨论(0)
  • 2021-02-01 01:36

    For me it was:

    export PYTHONPATH=/usr/bin/python3
    export PATH=$HOME/.local/bin:$PATH
    export WORKON_HOME=$HOME/.virtualenvs
    export PROJECT_HOME=$HOME/Devel
    export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
    export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
    source ~/.local/bin/virtualenvwrapper.sh
    

    I changed the line to:

    export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv
    

    It worked.

    0 讨论(0)
  • 2021-02-01 01:37
    1. sudo find / -name "virtualenv"

      Then I find the executable file path is:

      /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/bin/virtualenv

    2. Touch a soft link in the /usr/local/bin/ directory or add the path to .bash_profile, I prefer the former:

      sudo ln -s /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/bin/virtualenv /usr/local/bin/virtualenv
      
    0 讨论(0)
  • 2021-02-01 01:38
    1. Find where is your virtualenvwrapper located. in my case
     ~/.local/bin
    

    May be it's installed in

    /usr/local/bin/
    

    It totally depends on the System or Package Manager you are using.

    1. Add this path in your shell configuration .bashrc or .zshrc or whatever by simply
    PATH=$PATH:<directory_you_want_to_add>
    

    for example

    PATH=$PATH:~/.local/bin
    

    Also add the following configuration in .bashrc or .zshrc

    # the path you want your virtual environments to be saved and loaded from
    export WORKON_HOME=$HOME/.virtualenvs 
    export PROJECT_HOME=$HOME/<project_folder>
    
    # most important, this is the program which loads virtualenv
    # please update the path where virtualenvwrapper.sh is located
    source /usr/local/bin/virtualenvwrapper.sh 
    

    Don't Forget to restart the shell.. or reload the configuration...

    To test whether it worked

    mkvirtualenv test
    

    if you see a test environment created then everything is ok.

    For Detailed Installation Instructions go to the docs: virtualenvwrapper installation

    0 讨论(0)
  • 2021-02-01 01:40

    The way I did it was (using zsh) in this way:

    export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/username/Library/Python/2.7/bin:$PATH

    I simply located the file of virtualenvwrapper.sh inside this path /Users/username/Library/Python/2.7/bin:$PATH

    and added that path to PATH.

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