【发布时间】:2012-02-25 16:33:48
【问题描述】:
$ sudo pip install bottle
Downloading/unpacking bottle
Downloading bottle-0.10.7.tar.gz (55Kb): 55Kb downloaded
Running setup.py egg_info for package bottle
Installing collected packages: bottle
Found existing installation: bottle 0.10.7
Uninstalling bottle:
Successfully uninstalled bottle
Running setup.py install for bottle
changing mode of build/scripts-2.6/bottle.py from 640 to 755
changing mode of /usr/local/bin/bottle.py to 755
Successfully installed bottle
>>> help('modules')
blahblah
bottle
blahblah
$ ls /usr/local/lib/python2.6/dist-packages/
bottle-0.10.7.egg-info bottle.py bottle.pyc
但是
$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bottle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named bottle
wtf??? Ubuntu 10.10
解决方案:# chmod -R 775 /usr/local/lib/python2.6/dist-packages/ 对我有帮助。谢谢大家。
【问题讨论】:
-
which python说什么? -
>>> print sys.path ['', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib /python2.6/lib-tk'、'/usr/lib/python2.6/lib-old'、'/usr/lib/python2.6/lib-dynload'、'/usr/local/lib/python2. 6/dist-packages'、'/usr/lib/python2.6/dist-packages'、'/usr/lib/python2.6/dist-packages/Numeric'、'/usr/lib/python2.6/dist -packages/PIL'、'/usr/lib/python2.6/dist-packages/gst-0.10'、'/usr/lib/pymodules/python2.6'、'/usr/lib/python2.6/dist-包/gtk-2.0'、'/usr/lib/pymodules/python2.6/gtk-2.0'、'/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode']
-
嗯。 PIP 将瓶子安装到错误的位置?
-
不,
/usr/local/lib/python2.6/dist-packages存在。 -
# chmod -R 775 /usr/local/lib/python2.6/dist-packages/ 对我有帮助。谢谢大家。
标签: python ubuntu ubuntu-10.10 bottle