[英]Set python version for each virtualenv using 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.