【发布时间】:2014-01-21 06:42:43
【问题描述】:
我会让你快速上手。我正在尝试设置 Windows 开发环境。我已经成功安装了python、django和virtualenv + virtualenwrapper(windows-cmd installer)
workon env
Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1,6,1, 'final',0)
>>> quit()
但是当我从我的克隆存储库中运行:python manage.py runserver 时,我得到了这个错误:
Traceback (most recent call last)"
File "manage.py", line 2, in (module)
from django.core.management import execute_manager
ImportError: cannot import name execute_manager
python 和 django 都添加到我的系统变量 PATH 中:
...C:\Python27\;C:\Python27\Scripts\;C:\PYTHON27\DLLs\;C:\PYTHON27\LIB\;C:\Python27\Lib\site-packages\;
我也用 bash 和 powershell 试过这个,但我仍然得到同样的错误。
这是与 virtualenv 相关的问题吗? Django依赖问题?哎呀。我该如何解决这个问题?帮助我 Stackoverflow-kenobi 你我唯一的希望。
【问题讨论】:
-
你真的在使用 virtualenv 吗?它的重点是不使用系统范围的python解释器及其库。检查接受的问题答案:stackoverflow.com/questions/6049933/… 它涉及 virtualenv 设置。
-
@matcheek 嗯,看起来我没有正确运行 virtualenv。运行正确的 django 版本后,我收到此错误:ImportError: No module named djcelery.
-
@matcheek 我检查了 django 是否会在我的环境之外的 python 中运行,并且确实如此。您建议的链接也适用于 linux 环境。
标签: python django virtualenv virtualenvwrapper