我在django 1.0.4中使用旧项目,使用python 2.7进行viertualenv。 当我尝试我的一个脚本时,我在这个地方发现了一个错误:
from django.template import Context, loader
错误:
Traceback (most recent call last): File "path to file.py", line 6, in from django.template import Context, loader ImportError: No module named django.template
有人有这样的错误吗?
修改
安装:
Collecting https://www.djangoproject.com/download/1.0.4/tarball/
Downloading https://www.djangoproject.com/download/1.0.4/tarball/ (5.1MB)
100% |████████████████████████████████| 5.1MB 332kB/s
Cannot determine compression type for file /tmp/pip-KiWjIE-unpack/tarball.obj
Installing collected packages: Django
Running setup.py install for Django ... done
Successfully installed Django-1.0.4
Requriments:
appdirs==1.4.3
Django==1.0.4
MySQL-python==1.2.3
olefile==0.44
packaging==16.8
Pillow==4.1.1
pkg-resources==0.0.0
pyparsing==2.2.0
python-memcached==1.58
six==1.10.0
我也遇到错误:from django.core.management import setup_environ