2

最近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
4

3 に答える 3

9

p4tux言ったこと

virtualenvはsetuptoolsではなくdistributeを使用しています

export VIRTUALENV_DISTRIBUTE=true

で環境を作成する前に

virtualenv ENV

またはします

$ python virtualenv.py --distribute ENV

virtualenvのドキュメントを参照してください

于 2012-10-31T16:04:02.687 に答える
4

virtualenv は現在、setuptools ではなく、distribute を使用しています

エクスポート VIRTUALENV_DISTRIBUTE=true

于 2012-09-10T23:07:50.393 に答える
0

このリンク:

https://gist.github.com/3179227

(pythonbrewを使用して)一時的に問題を解決したようです。ミックスに別のコンポーネント(pythonbrew)を入れたくないので、他の誰かがvirtualenvをMLでうまく機能させる方法に加担してくれることを願っています。

于 2012-09-03T23:51:58.520 に答える