1
我已經通過管理員安裝在/usr/lib64/...
模塊強制現有模塊安裝在一個特定的路徑
Python 2.7.6 (default, Nov 11 2013, 13:13:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> print matplotlib.__file__
/usr/lib64/python2.7/site-packages/matplotlib/__init__.pyc
我想現在要做的就是要把它安裝在:
/home/myname/.local/lib/python2.7/site-packages
但是,當我嘗試使用這個命令來安裝它:
$ easy_install-2.7 --install-dir=/home/myname/.local/lib/python2.7/site-packages matplotlib
我所得到的是這樣的:
packages matplotlib
Searching for matplotlib
Best match: matplotlib 1.3.1
Adding matplotlib 1.3.1 to easy-install.pth file
Using /usr/lib64/python2.7/site-packages
Processing dependencies for matplotlib
Finished processing dependencies for matplotlib
這意味着它不會安裝在所有。我再一次證實了這一點:
>>> import matplotlib
>>> print matplotlib.__file__
or
$ ls -lh /home/myname/.local/lib/python2.7/site-packages
我怎樣才能得到它安裝在我所需的路徑和繞過已經安裝的版本。
如果我按照這些步驟,將安裝matplotlib的路徑? – neversaint
到你的''HOME''。通常是''$ HOME/lib/python2.7/site-packages''或類似的。 –
我目前的python路徑是這樣的:'export PYTHONPATH =/home/myname/.local/lib/python2.7/site-packages'。這夠了嗎? Coz現在python無法識別matplotlib的位置。 – neversaint