使用pip报编码错误,使用django startproject test也报编码错误

如下图所示,使用pip时报错

  File "D:\Microsoft Visual Studio\Shared\Anaconda3_64\Scripts\pip.exe", line 1
SyntaxError: Non-UTF-8 code starting with '\x90' in file D:\Microsoft Visual Stu
dio\Shared\Anaconda3_64\Scripts\pip.exe on line 1, but no encoding declared; see
 http://python.org/dev/peps/pep-0263/ for details

在命令行中使用django-admin时也是相同的错误,但在pycharm中却可以正常创建django项目。

查了许久一直未找到原因,pip报错最后用重装pip的方式解决了,在命令行中输入easy_install pip,重装后恢复正常。

C:\Users\caiml>easy_install pip
Searching for pip
Best match: pip 19.0.3
Adding pip 19.0.3 to easy-install.pth file
Installing pip-script.py script to D:\Microsoft Visual Studio\Shared\Anaconda3_6
4\Scripts
Installing pip.exe script to D:\Microsoft Visual Studio\Shared\Anaconda3_64\Scri
pts
Installing pip3-script.py script to D:\Microsoft Visual Studio\Shared\Anaconda3_
64\Scripts
Installing pip3.exe script to D:\Microsoft Visual Studio\Shared\Anaconda3_64\Scr
ipts
Installing pip3.7-script.py script to D:\Microsoft Visual Studio\Shared\Anaconda
3_64\Scripts
Installing pip3.7.exe script to D:\Microsoft Visual Studio\Shared\Anaconda3_64\S
cripts

Using d:\microsoft visual studio\shared\anaconda3_64\lib\site-packages
Processing dependencies for pip
Finished processing dependencies for pip

 

命令行中输入easy_install django重装django,又报错系统缺少Microsoft Visual C++ Build Tools 2014,到http://go.microsoft.com/fwlink/?LinkId=691126下载Microsoft Visual C++ Build Tools 2015后默认安装后,再使用

easy_install django重装django后恢复正常。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值