Python Virtualenv - No module named virtualenvwrapper.hook_loader

前端 未结 16 1501
野趣味
野趣味 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条回答
  •  Happy的楠姐
    2020-12-02 06:36

    I just installed python 3.5,tried the virtualenvwrapper and then had this problem. I came to realize that python3.5 was installed in /usr/local/bin/python3.5 and NOT /usr/bin/python3.5. So, I revised my .bash_profile script to look like the following and everything seems to work now

    # Setting PATH for Python 3.5
    # The orginal version is saved in .bash_profile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
    export PATH
    export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3.5
    export WORKON_HOME=$HOME/.virtualenvs
    source /Users/bentaub/.virtualenvs/djangodev/bin/virtualenvwrapper.sh
    

    I'm enough of a novice to not be sure how that 'local' in the path to python3.5 is going to affect me in the long run but, for now, it works.

提交回复
热议问题