我收到以下错误:
(virtualenv)[chirdeep@fedora-desktop ~]$ python programs/python/myrestapi.py
Traceback (most recent call last):
File "programs/python/myrestapi.py", line 2, in <module>
import bottle
File "/home/chirdeep/programs/python/bottle.py", line 1, in <module>
from bottle import route, run
ImportError: cannot import name route
我有 python 2.7.3 和 3.2.3。(virtualenv) 指向 python3,我在这里安装了瓶子,它可以在 site-packges 下找到。
激活环境后,我可以在 python 控制台下导入瓶子。
(virtualenv)[chirdeep@fedora-desktop ~]$ python
Python 3.2.3 (default, Jul 26 2012, 22:03:19)
[GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bottle
>>>
任何帮助将不胜感激,让我发疯。
谢谢