在cygwin中设置路径

时间:2013-09-02 05:35:29

标签: python module path cygwin

我得到了错误

        ImportError: No module named matplotlib

但是我在python2.7下安装了它,可以看到位置。如果我知道文件位置,有没有办法让cygwin识别它?当我问“哪个matplotlib”它只是告诉我它不在像这样的奇怪的文件夹位置链

 $ which matplotlib
which: no matplotlib in (/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/cygdrive/c/Program Files (x86)/Silverfrost/FTN95:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/windows/system32:/cygdrive/c/windows:/cygdrive/c/windows/System32/Wbem:/cygdrive/c/windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/WIDCOMM/Bluetooth Software:/cygdrive/c/Program Files/WIDCOMM/Bluetooth Software/syswow64:/cygdrive/c/Program Files (x86)/Pinnacle/Shared Files:/cygdrive/c/Program Files (x86)/Pinnacle/Shared Files/Filter:/cygdrive/c/Program Files (x86)/Windows Live/Shared:/cygdrive/c/Program Files (x86)/QuickTime/QTSystem:%CYGWIN_HOME%/bin:%CYGWIN_HOME%/sbin:%CYGWIN_HOME%/usr/bin:%CYGWIN_HOME%/usr/sbin:%CYGWIN_HOME%/usr/local/bin:%CYGWIN_HOME%/usr/local/sbin:/cygdrive/c/Anaconda:/cygdrive/c/Anaconda/Scripts:/usr/lib/python2.7/user/scripts:/usr/lib/python2.7/User:/usr/lib/python2.7/User/Scripts:/usr/lib/lapack:/usr/openwin/bin:/cygdrive/c/python27:/cygdrive/c/Anaconda:/cygdrive/c/Anaconda/python:/c/Anaconda:/cygdrive/Anaconda:/cygdrive/c/Anaconda:/cygdrive/c/Anaconda:/cygdrive/c/Anaconda/Python27:/cygdrive/c/Python27:/cygdrive/c/Python27)

(有几个提到的蟒蛇,但我相信,当我在一天乱来的时候,它是试图将它放在Cygwin中的残余物)

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

尝试

import sys
a="your path to python/lib/site-packages"
sys.path.append(a)

然后你应该可以从cygwin

import matplotlib