美文网首页
python - 在 Mac OS X Yosemite 上,v

python - 在 Mac OS X Yosemite 上,v

作者: Vito_Wen | 来源:发表于2018-06-05 14:56 被阅读0次

    我使用 Homebrew 安装了 python 2和 3 。

    $ which python
    /usr/local/bin/python
    $ which python3
    /usr/local/bin/python3
    $ which pip
    /usr/local/bin/pip
    $ which virtualenv
    /usr/local/bin/virtualenv
    $ which virtualenvwrapper.sh
    /usr/local/bin/virtualenvwrapper.sh
    

    下面是我的。bash_profile中的信息:

    export PATH=/usr/local/bin:$PATH
    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
    

    每当我终端打开的时候都会报以下信息:

    /usr/local/opt/python/bin/python2.7: No module named virtualenvwrapper
    virtualenvwrapper.sh: There was a problem running the initialization hooks. 
    If Python could not import the module virtualenvwrapper.hook_loader,
    check that virtualenvwrapper has been installed for
    VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python and that PATH is
    set properly.
    

    因为我已经在 python 3上安装了 virtualenvwrapper 。 还需要在python2上安装它,解决方法如下

    pip install virtualenvwrapper
    

    相关文章

      网友评论

          本文标题:python - 在 Mac OS X Yosemite 上,v

          本文链接:https://www.haomeiwen.com/subject/pzgpsftx.html