刚刚从ubuntu 12.10升级到13.04并在virtualenv中运行django站点时获取此内容
(virtualenv)sysadmin@ubuntu:~/webapps/devsite/djangosite$ ./manage.py runserver
Traceback (most recent call last):
File "./manage.py", line 2, in <module>
from django.core.management import execute_manager
File "/home/sysadmin/webapps/devsite/virtualenv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 7, in <module>
from django.core.management.base import BaseCommand, CommandError, handle_default_options
File "/home/sysadmin/webapps/devsite/virtualenv/local/lib/python2.7/site-packages/django/core/management/base.py", line 14, in <module>
from django.utils.encoding import smart_str
File "/home/sysadmin/webapps/devsite/virtualenv/local/lib/python2.7/site-packages/django/utils/encoding.py", line 4, in <module>
import datetime
ImportError: No module named datetime
答案 0 :(得分:43)
只做
virtualenv /home/sysadmin/webapps/devsite/virtualenv/
这将在VirtualEnv中重新安装Python,之后它将起作用(并且您不需要重新安装库)。