繁体   English   中英

在没有自制软件的Python的情况下使用virtualenv和virtualenvwrapper

[英]Using virtualenv and virtualenvwrapper without homebrew's Python

我使用Homebrew来管理大多数软件安装,但是我发现使用Python(尤其是virtualenv(和virtualenvwrapper))以单独的方式管理软件包非常复杂。 问题是我发现virtualenv将python符号链接到通过Homebrew安装的当前版本的Python,如下所示:

~/.pip/virtualenvs/httpie
├── include
│   └── python2.7 -> /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/include/python2.7
└── lib
    └── python2.7
        ├── UserDict.py -> /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py
        ├── UserDict.pyc
        ├── _abcoll.py -> /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py
        ├── _abcoll.pyc
        ├── _weakrefset.py -> /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py
        ├── _weakrefset.pyc
        ├── abc.py -> /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py
        ├── abc.pyc
        ├── codecs.py -> /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py
        ├── codecs.pyc
[...]

每当通过自制程序对Python进行更新时,这会引起各种链接问题:

$ http --head http://flic.kr/p/dQm85A
dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /Users/3dweb/.pip/virtualenvs/httpie/bin/python2.7
  Reason: image not found
Trace/BPT trap: 5

每当创建新的virtualenv时,如何将virtualenv设置为始终(自动)指向系统Python?

通过自制软件以外的pip将virtualenv安装到系统Python中。 直接调用virtualenv。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM