問題描述
選擇安裝 python 模塊的位置 (Choosing where to install python module)
I have an old version of PyML, 7.10, and I want to install the new version 7.11.
To do this I downloaded PyML and ran setup.py.
However, when I run
sudo python setup.py install
The result is:
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site‑packages/PyML‑0.7.11‑py2.7.egg‑info
Writing /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site‑packages/PyML‑0.7.11‑py2.7.egg‑info
This seems fine and dandy, but running
print PyML.__file__
tells me that python looks for PyML in the folder
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site‑packages/PyML/
not
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site‑packages/PyML‑0.7.11‑py2.7.egg‑info
where it was written, according to setup.py
Therefore I want to change the install path to /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site‑packages/PyML/
How do I do this?
‑‑‑‑‑
參考解法
方法 1:
It already is installed there. The .egg‑info
file simply gives setuptools more information about the package such as version, requirements, etc. and should not be moved from there.
(by The Unfun Cat、Ignacio Vazquez‑Abrams)