0

I am using Python 2.7 and pip to install Django on Windows 8 and encountered an Errno22. I typed "python -m pip install Django==1.7" and get

...
...
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. I tried to modify the code in util.py but with in vain. This is an Administrator command prompt so privilege should not be the cause. Any ideas how to resolve this?

3
  • Why are you adding python -m in front of it? Commented Sep 7, 2014 at 17:01
  • @AshwiniChaudhary did not see your comment, I added it as an answer. Shall I remove it, if it is more suitable as comment? Commented Sep 7, 2014 at 17:05
  • @AshwiniChaudhary Just to avoid version conflict. "pip install Django==1.7" gives the same result. Commented Sep 8, 2014 at 3:27

1 Answer 1

1

You are unnecessarily adding an extra parameter: python -m pip install Django==1.7

It should be:

python pip install Django==1.7

Sign up to request clarification or add additional context in comments.

1 Comment

It's hardly because of this reason. I only added this to avoid version conflicts. I can of course just type "pip install Django==1.7", but it will give the same result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.