当我使用pip安装数据包时(例如patsy)
[sudo] pip install patsy
Downloading/unpacking patsy
Downloading patsy-0.1.0.tar.gz (258kB): 258kB downloaded
Running setup.py egg_info for package patsy
no previously-included directories found matching 'doc/_build'
Requirement already up-to-date: numpy in /usr/lib/python2.7/dist-packages (from patsy)
Installing collected packages: patsy
Running setup.py install for patsy
no previously-included directories found matching 'doc/_build'
Successfully installed patsy
Cleaning up...
并且pip安装在/usr/local/lib/python2.7/dist-packet/而不是/usr/lib/python2.7/dist-packet/中,当我尝试在Ipython中导入数据包时我有这个错误:
import patsy
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-9de22d189b17> in <module>()
----> 1 import patsy
ImportError: No module named patsy
我有Linux Mint Mate 15.我做错了什么?
答案 0 :(得分:1)
尝试修改您的PYTHONPATH,我建议您阅读以下http://www.stereoplex.com/blog/understanding-imports-and-pythonpath