【问题标题】:Problems Installing virtualenvwrapper on mountain lion在山狮上安装 virtualenvwrapper 的问题
【发布时间】:2012-08-28 13:15:21
【问题描述】:

我最近丢失了 HDD,目前正在重建我的笔记本电脑(运行 Mountain Lion)开发系统。今天下午我去安装virtualenvwrapper,遇到了一些奇怪的事情,阻止我安装virtualenvwrapper。

我做了以下事情:

  1. 已安装设置工具。
  2. 使用easy_install-2.7安装pip。
  3. 使用 pip-2.7 安装虚拟环境。

当我使用 pip-2.7 安装 virtualenvwrapper 时,我得到以下信息(见下文)。 -2.5,-2.6,-2.7 后缀对山狮来说似乎是新事物?我试过不带后缀的相同过程,但也没有用。

我之所以发帖,是因为我怀疑这里有些地方出了问题,并且想在它成为一个更隐蔽的问题之前找到它的根源。

下载并安装新版本的 2.7 并设置我的使用路径对我来说更好吗?


Downloads  sudo pip-2.7 install virtualenvwrapper   
Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /Library/Python/2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /Library/Python/2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): stevedore in /Library/Python/2.7/site-packages (from virtualenvwrapper)
Downloading/unpacking distribute (from stevedore->virtualenvwrapper)
  Downloading distribute-0.6.28.tar.gz (627kB): 627kB downloaded
  Running setup.py egg_info for package distribute

Installing collected packages: distribute
  Running setup.py install for distribute
    Before install bootstrap.
    Scanning installed packages
    Setuptools installation detected at /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
    Egg installation
    Patching...
    Renaming /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1346705360.93
    Patched done.
    Relaunching...
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    NameError: name 'install' is not defined
    Complete output from command /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/tmp/pip-build/distribute/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-RMDd1X-record/install-record.txt --single-version-externally-managed:
    Before install bootstrap.

Scanning installed packages

Setuptools installation detected at /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg

Egg installation

Patching...

Renaming /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg into /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1346705360.93

Patched done.

Relaunching...

Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'install' is not defined

【问题讨论】:

    标签: virtualenv pip setuptools osx-mountain-lion


    【解决方案1】:

    p4tux 说了什么

    virtualenv 现在使用的是分发而不是 setuptools

    export VIRTUALENV_DISTRIBUTE=true

    在创建环境之前

    virtualenv ENV
    

    或者做

    $ python virtualenv.py --distribute ENV
    

    virtualenv documentation

    【讨论】:

      【解决方案2】:

      virtualenv 现在使用的是分发而不是 setuptools

      导出 VIRTUALENV_DISTRIBUTE=true

      【讨论】:

      • 我也正在经历这个。您能否详细说明何时应设置此变量?
      【解决方案3】:

      此链接:

      https://gist.github.com/3179227

      (使用 pythonbrew)似乎暂时为我解决了这个问题。我不想在组合中加入另一个组件(pythonbrew),所以希望其他人能够参与如何让 virtualenv 与 ML 很好地配合。

      【讨论】:

        猜你喜欢
        • 2013-02-08
        • 2012-11-08
        • 1970-01-01
        • 1970-01-01
        • 2012-09-16
        • 2012-09-03
        • 2013-09-24
        • 2013-01-29
        • 1970-01-01
        相关资源
        最近更新 更多