python - 无法在 virtualenv 中的 Windows 上安装 Django

标签 python django

我在我的 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/

相关文章:

javascript - 如何从django中的日期选择器获取日期

python - 查找 2 个大写字母之前的 n 个以大写字母开头的单词(正则表达式)

python - 为什么我不能实现 Django 的忘记密码功能?

html - 将django表单中的外键字段设置为只读,并且仍然允许提交表单

python - heroku 上的 django : ImportError: cannot import name get_path_info

python - 无法实现基于类的非二进制 id3 决策解决方案

python - 防止添加不同形状的数组

python - 如何使 Django REST Framework 返回超链接列表而不是一个列表中的所有数据?

python - Django JSON反序列化安全

python - pygame 移动 blitted 文本