StackOverflow上有关此错误的其他问题的答案并未解决我的问题。
从一开始,我输入:
$ virtualenv ./env
New python executable in ./env/bin/python2.7
Also creating executable in ./env/bin/python
Installing setuptools, pip...done.
$ source ./env/bin/activate
(env)$ pip install django
Downloading/unpacking django
Downloading Django-1.6.5-py2.py3-none-any.whl (6.7MB): 6.7MB downloaded
Installing collected packages: django
Successfully installed django
Cleaning up...
(env)$ django-admin.py startproject myproject
(env)$ cd myproject
(env)$ python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
(env)$ which python
/home/twitch/Projects/env/bin/python
(env)$ python --version
Python 2.7.6
有关为何会发生这种情况的任何想法?
答案 0 :(得分:0)
你的django软件包的pip安装错误。尝试从http://djangoproject.com站点下载django(您选择的版本)源代码,并通过setup.py直接安装它。它真的很简单。随着你的virtualenv被激活:
就是这样。