我在我的项目中使用django_cups
,我在模型行4中遇到导入错误。Here is the models.py
file
python ./manage.py runserver
...
File "/home/lex/myapp/django_cups/models.py", line 4, in <module>
import cups
ImportError: No module named cups
我安装了django_cups
,因为当我在python shell中import cups
时它没有抱怨。
lex@lex-pc:~/django/mykapp$ python
Python 2.7.4 (default, Apr 19 2013, 18:32:33)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cups
>>>
>>>
但是当我在Django的InteractiveConsole中这样做时,它抱怨......
(env)lex@lex-pc:~/django/myapp$ python ./manage.py shell
Python 2.7.4 (default, Apr 19 2013, 18:32:33)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import cups
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named cups
>>>
这可能是什么问题?