简体   繁体   English

在 Windows 8 上使用 pip 安装 Python Django 时出错

[英]Error installing Python Django using pip on Windows 8

I am using Python 2.7 and pip to install Django on Windows 8 and encountered an Errno22.我正在使用 Python 2.7 和 pip 在 Windows 8 上安装 Django,但遇到了 Errno22。 I typed "python -m pip install Django==1.7" and get我输入“python -m pip install Django==1.7”并得到

...
...
File "D:\Python27\lib\site-packages\pip\util.py", line 508, in unzip_file
fp = open(fn, 'wb')
IOError: [Errno 22] invalid mode ('wb') or filename: 'c:\\users\\[username]~1\\appda
ta\\local\\temp\\pip_build_[username]\\django\\django/contrib/admin/locale/l
t/LC_MESSAGES/django.mo'

Looks like it's a typical backslash problem of pip on Windows.看起来这是 Windows 上 pip 的典型反斜杠问题。 I tried to modify the code in util.py but with in vain.我试图修改 util.py 中的代码但徒劳无功。 This is an Administrator command prompt so privilege should not be the cause.这是管理员命令提示符,因此权限不应该是原因。 Any ideas how to resolve this?任何想法如何解决这个问题?

You are unnecessarily adding an extra parameter: python -m pip install Django==1.7您不必要地添加了一个额外的参数: python -m pip install Django==1.7

It should be:它应该是:

python pip install Django==1.7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM