Terminal issue with virtualenvwrapper after Mavericks Upgrade

后端 未结 8 2003
离开以前
离开以前 2020-12-07 20:41

After upgrading to OSX Mavericks, I am getting this message in the terminal:

/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There w         


        
相关标签:
8条回答
  • 2020-12-07 20:58

    You just need to configure the path properly. Run the following commands in the terminal:

    1. which python

    Output -

    /usr/bin/python
    
    1. which virtualenvwrapper.sh

    Output -

    /usr/local/bin/virtualenvwrapper.sh
    
    1. echo $VIRTUALENVWRAPPER_PYTHON

      /usr/local/bin/python

    So as you can see that the variable $VIRTUALENVWRAPPER_PYTHON is pointing towards the wrong python path. So we need to reset the path of variable $VIRTUALENVWRAPPER_PYTHON.

    1. export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python

    now run the following the command:

    source /usr/local/bin/virtualenvwrapper.sh 
    
    0 讨论(0)
  • 2020-12-07 21:01

    Try edit .bash_profile file

    # Home brew
    export PATH=/usr/local/bin:$PATH
    
    # virtualenvwrapper 
    export WORKON_HOME=$HOME/.virtualenvs
    export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
    export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
    source /usr/local/bin/virtualenvwrapper.sh
    
    0 讨论(0)
  • 2020-12-07 21:03

    pip install --upgrade virtualenvwrapper will fix the issue but never used sudo pip this will change system-wide. If pip throws permission errors without sudo then you should fix those and then try only with pip install <--upgrade> $(package).

    I rather suggest install homebrew and then install pip using brew install pip which will install latest stable version of pip for you.

    1. Install homebrew and then run brew doctor . If there are any warnings fix those(actually brew will tell you how to fixed those).

    2. You may need to remove system-wide python comes with Mac and use brew to install required versions. Use this to remove system-wide python

    3. Use brew install python or/and brew install python3 to install required python version/s.
    4. Finaly run pip install --upgrade virtualenvwrapper

    5. Now on never use sudo pip only use pip.

    0 讨论(0)
  • 2020-12-07 21:08

    Running these two commands helped me get rid of it (had done a software update on macOS High Sierra)

    $ sudo easy_install pip
    
    $ sudo pip install --upgrade virtualenvwrapper
    
    0 讨论(0)
  • 2020-12-07 21:09

    Try reinstalling pip and then reinstalling virtualenvwrapper (I had to go through these steps after upgrading to Mavericks):

    $ sudo easy_install pip
    $ sudo pip install --upgrade virtualenvwrapper
    
    0 讨论(0)
  • 2020-12-07 21:09

    I had the same problem with MacOS High Sierra. I was able to fix it with these lines in my .bash_profile file:

    export WORKON_HOME=$HOME/.virtualenvs
    export PROJECT_HOME=$HOME/Code
    export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python2
    export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
    source /usr/local/bin/virtualenvwrapper.sh
    
    0 讨论(0)
提交回复
热议问题