Error with pointing to correct python version: virtualenvwrapper.sh

后端 未结 3 1622
走了就别回头了
走了就别回头了 2021-02-04 13:31

I get this error when I boot up terminal:

Last login: Thu Apr  9 19:49:08 on ttys001
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Conte         


        
3条回答
  •  -上瘾入骨i
    2021-02-04 14:08

    I had the same exact issue and updating my path didn't help anything, nor did setting VIRTUALENVWRAPPER_PYTHON and VIRTUALENVWRAPPER_VIRTUALENV. This is because I was seeing this strange behavior when running my version of python:

    $ /usr/local/bin/python
    Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> print sys.executable
    /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
    

    I was able to fix everything by uninstalling python with brew, reinstalling python with brew, and forcing it to overwrite existing symlinks in /usr/local/bin.

    brew uninstall --force python
    brew install python
    brew link --overwrite python
    brew linkapps python
    pip install --upgrade pip setuptools
    sudo pip uninstall virtualenv
    pip install virtualenv
    sudo pip uninstall virtualenvwrapper
    pip install virtualenvwrapper
    

    Hopefully you were able to get past this issue when you encountered it six months ago. I wanted to post my solution in case others run in to the same issue and cannot solve it by setting their paths and env variables.

提交回复
热议问题