我在我的 virtualenv 中使用 PIP 安装 Django,我收到以下消息: 要求已经满足(使用 --upgrade 升级):django in virtual\env\folder\lib\site-packages\django-1.7.6-py2.7.egg
但是在本教程中,它期望在 lib 文件夹中有一个 django-admin.py 文件。以前使用 Windows 时使用 lib==scripts 但文件既不在 lib 中也不在脚本中。
为了将我的 django-admin 文件放在正确的目录中,我需要做什么?
脚本目录:
Directory of C:\virtual\env\folder\Scripts
18/03/2015 10:23 <DIR> .
18/03/2015 10:23 <DIR> ..
18/03/2015 10:23 2,379 activate
18/03/2015 10:23 596 activate.bat
18/03/2015 10:23 8,252 activate.ps1
18/03/2015 10:23 1,129 activate_this.py
18/03/2015 10:23 348 deactivate.bat
18/03/2015 10:22 95,138 easy_install-2.7.exe
18/03/2015 10:22 95,138 easy_install.exe
18/03/2015 10:23 95,110 pip.exe
18/03/2015 10:23 95,110 pip2.7.exe
18/03/2015 10:23 95,110 pip2.exe
18/03/2015 10:22 26,624 python.exe
18/03/2015 10:22 27,648 pythonw.exe
12 File(s) 542,582 bytes
2 Dir(s) 54,728,036,352 bytes free
谢谢
最佳答案
你试过 virtualenvwrapper 了吗?它使开发人员的生活变得非常非常轻松。
pip install virtualenvwrapper
然后是入门示例:
mkvirtualenv myproject # only necessary the first time
workon myproject # for an existing virtualenv
pip install django
django-admin.py startproject myproject
...
deactivate virtualenvwrapper
virtualenvwrapper 解决了我在 Windows 上遇到的许多路径问题(我有一个必须支持特定版本的 Windows、Mac 和 Vagrant 的虚拟机)。我希望这会有所帮助。
问候,
-蒂姆
关于python - 无法在 virtualenv 中的 Windows 上安装 Django,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29172342/