刚好安装了pycharm,打算用这个ide来开发python,所以新建了一个django的工程,但是提示django的第三方库安装失败。真坑爹啊。
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip-1.5.6-py2.7.egg\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip-1.5.6-py2.7.egg\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip-1.5.6-py2.7.egg\pip\req.py", line 1197, in prepare_files
do_download,
File "C:\Python27\lib\site-packages\pip-1.5.6-py2.7.egg\pip\req.py", line 1375, in unpack_url
self.session,
File "C:\Python27\lib\site-packages\pip-1.5.6-py2.7.egg\pip\download.py", line 571, in unpack_http_url
temp_location = os.path.join(temp_dir, filename)
File "C:\Python27\lib\ntpath.py", line 84, in join
result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcd in position 7: ordinal not in range(128)
解决方法:手动安装。在powershell中
PS C:\Python27\Scripts> (Invoke-WebRequest 外链网址已屏蔽).Content | C:\Python27\python.exe -
安装easy_install, 然后在Scripts目录
PS C:\Python27\Scripts> (Invoke-WebRequest 外链网址已屏蔽).Content | C:\Python27\python.exe -
最后还是用了easy_install安装了,用pip无法安装,错误是一样的。产生错误的原因就是上面日志写的。我用的是win8系统,绑定了outlook帐号后,用户名是中文的,这个是相当的坑爹啊。temp_dir也是带有中文的,然后就是乱码了!!!给跪了
解决方法其实也很简单,去修改下pip的代码。。。。