Python Virtualenv - No module named virtualenvwrapper.hook_loader

前端 未结 16 1516
野趣味
野趣味 2020-12-02 06:01

I\'m running Mac OS 10.6.8. and wanted to install in addition to python 2.6 also python 2.7 and use python 2.7 in a new virtualenv. I executed the following steps:

I

16条回答
  •  星月不相逢
    2020-12-02 06:18

    The issue was solved following the steps below:

    #switch the /usr/bin/python link to point to current python link
    cd /usr/bin
    sudo mv python python.bak
    sudo ln -s /Library/Frameworks/Python.framework/Versions/Current/bin/python python
    

    Re-arrange the export command in order that it is placed before the virtualenv commands in my .bash_profile file:

    PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH
    export PATH
    
    # needed for virtualenvwrapper
    export WORKON_HOME=$HOME/.virtualenvs
    source /usr/local/bin/virtualenvwrapper.sh
    

    Re-Install setuptools, easy install and PIP. This is obviously needed in order that they work properly with the new python version:

    sudo sh setuptools-0.6c11-py2.7.egg
    
    sudo easy_install-2.7 pip
    
    pip install virtualenv
    

提交回复
热议问题