我必须在INSTALLED_APPS设置中引用reportlab吗?

时间:2014-08-22 07:58:19

标签: django reportlab

我安装了reportlab库

> pip install reportlab
Requirement already satisfied (use --upgrade to upgrade): reportlab in /usr/local/lib/python2.7/dist-packages

我不知道是否必须在我的设置中引用它:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Other
    'crispy_forms',
    'django_extensions',
    'south',
    'reportlab',
)

但如果我这样做:

app = import_module(appname)
   File "/home/jesus/programas/cronos/usr/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
     __import__(name) ImportError: No module named reportlab

否则

当我导入库时:

Python 2.7.3 (default, Jan  2 2013, 16:53:07)  [GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from reportlab.pdfgen import canvas
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named reportlab.pdfgen
>>> import reportlab
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named rreportlab

???????

0 个答案:

没有答案