安装了virtualenv和virtualenvwrapper:Python说没有名为virtualenvwrapper的模块 [英] Installed virtualenv and virtualenvwrapper: Python says no module named virtualenvwrapper

查看:116
本文介绍了安装了virtualenv和virtualenvwrapper:Python说没有名为virtualenvwrapper的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很多其他关于类似问题的主题,但是我找不到与我完全相同的案例.因此,这里是:

Lots of other threads about similar issues, but none that I could find where quite the same case as mine. So, here goes:

我所做的事情:

  • Ran:sudo easy_install pip
  • Ran:sudo pip install virtualenv
  • Ran:sudo pip install virtualenvwrapper
  • Ran: sudo easy_install pip
  • Ran: sudo pip install virtualenv
  • Ran: sudo pip install virtualenvwrapper

当前状态:

  • .bash_profile

  • .bash_profile

export PATH=/usr/local/bin:$PATH
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
export WORKON_HOME=$HOME/.virtualenvs
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python

  • 运行mkvirtualenv test会导致:

  • Running mkvirtualenv test results in:

    New python executable in trunk/bin/python
    Installing setuptools, pip...done.
    /usr/bin/python: No module named virtualenvwrapper
    

  • 手动检查'/usr/local/bin'表明存在virtualenvwrapper.sh

  • Manually inspecting '/usr/local/bin' shows that virtualenvwrapper.sh exists

    我尝试过的事情:

    • 检查我的路径以确保它看起来像应该的样子
    • 重新安装pip,然后使用重新安装的pip重新安装virtualenv和virtualenvwrapper

    任何帮助使这项工作奏效的方法,将不胜感激.

    Any help getting this working would be very much appreciated.

    推荐答案

    在解决与您在此处描述的问题相同的问题后,我设法通过编辑我的〜/.bash_profile 和添加此内容:

    I've managed to get this working after having the same problem you've described here by editing my ~/.bash_profile and adding this:

    export WORKON_HOME=$HOME/code/.virtualenvs
    export PROJECT_HOME=$HOME/code
    export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
    export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
    export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
    
    source /usr/local/bin/virtualenvwrapper.sh
    

    保存,关闭.

    然后:

    $ source ~/.bash_profile
    

    和:

    $ mkvirtualenv test
    

    这篇关于安装了virtualenv和virtualenvwrapper:Python说没有名为virtualenvwrapper的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆