当前位置:网站首页>UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
2022-07-04 03:52:00 【活成自己的样子啊】
不是你是否也遇到了这个报错。
如果有,那么你来对地方了,一次性永久解决该问题。
如果没有,也可停下来看一看,以便以后更好的解决可能会出现的问题。
目录
事情的起因
这是在用python安装第三方库的时候遇到的问题,例如:pip install XXX
以前都没有问题的,知道有一次,出了这个问题,但是不记得自己改过有关编码的设置啊啊,,,
于是~~~
我开始满浏览器的搜,当然,也搜到了很多解决办法。
例如:
根据报错位置,一步一步往前索引,直到找到打开文件的地方,把encoding=参数设置成‘utf8’,或者是其他的中文字符集(啥样的都有)。
重新安装pip。。。
重新设置系统默认的编码字符集。。。
注:以上方法均不建议尝试。
一是不能从根本上解决问题。
二是有的方法根本解决不了问题。
原因分析
废话不多说,开始正题:
原因是系统的编解码方式的问题(因为我尝试过,把pip重装一遍还是解决不了问题【当时还怀疑是依赖冲突,于是我把anaconda重新装了一遍~~~】,但是都没有解决问题)
所以!!!
我们需要改变系统的编解码方式。
解决方法
添加环境变量
如图所示:在系统环境中加入以下变量。
最后一步:重启电脑!(不重启不会生效)
综述
不要太多的去修改库的源代码,不是长久的做法,也不一定正确,除非是操作系统的原因。
QQ:1757093754
欢迎交流!学习!
边栏推荐
- VIM mapping command
- (指针)自己写一个比较字符串大小的函数,功能与strcmp类似。
- How to add custom API objects in kubernetes (1)
- (pointeur) Écrivez - vous une fonction qui compare la taille de la chaîne et fonctionne comme strcmp.
- 分布式系统:what、why、how
- Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
- My opinion on how to effectively telecommute | community essay solicitation
- 程序员远程办公喜忧参半| 社区征文
- Redis:有序集合zset类型数据操作命令
- SDP中的SPA
猜你喜欢
Global exposure and roller shutter exposure of industrial cameras
Leetcode brush questions: binary tree 05 (flip binary tree)
Leetcode skimming: binary tree 07 (maximum depth of binary tree)
架构训练毕业设计+总结
Redis:哈希hash类型数据操作命令
Perf simple process for multithreaded profile
Lnk2038 detected a mismatch of "runtimelibrary": the value "md_dynamicrelease" does not match the value "mdd_dynamicdebug" (in main.obj)
leetcode刷题:二叉树08(N叉树的最大深度)
The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO
Redis:有序集合zset类型数据操作命令
随机推荐
Evolution of MySQL database architecture
Graduation summary
I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
leetcode刷题:二叉树04(二叉树的层序遍历)
架构实战营 - 第 6 期 模块九之毕业设计
How to add custom API objects in kubernetes (1)
Touch and take you to implement an EventEmitter
分布式系统:what、why、how
vim映射命令
Ppt tutorial, how to save a presentation as a PDF file in PowerPoint?
(指針)自己寫一個比較字符串大小的函數,功能與strcmp類似。
(指针)编写函数void fun(int x,int *pp,int *n)
There is a problem that the package cannot be parsed in the like project
【读书会第十三期】多媒体处理工具 FFmpeg 工具集
My opinion on how to effectively telecommute | community essay solicitation
[csrf-01] basic principle and attack and defense of Cross Site Request Forgery vulnerability
(pointeur) Écrivez - vous une fonction qui compare la taille de la chaîne et fonctionne comme strcmp.
10 reasons for not choosing to use free virtual hosts
Storage of MySQL database
【webrtc】m98 ninja 构建和编译指令