当前位置:网站首页>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
欢迎交流!学习!
边栏推荐
- I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
- Common methods of threads
- vim映射命令
- Flink learning 8: data consistency
- 分布式系统:what、why、how
- Getting started with the go language is simple: go implements the Caesar password
- Brief explanation of depth first search (with basic questions)
- Understand the principle of bytecode enhancement technology through the jvm-sandbox source code
- 统计遗传学:第三章,群体遗传
- [book club issue 13] packaging format of video files
猜你喜欢

leetcode刷题:二叉树04(二叉树的层序遍历)

软件测试是干什么的 发现缺陷错误,提高软件的质量

Two commonly used graphics can easily realize data display

2021 RSC | Drug–target affinity prediction using graph neural network and contact maps

idea修改主体颜色

dried food! Generation of rare samples based on GaN

2020 Bioinformatics | TransformerCPI

There is a problem that the package cannot be parsed in the like project

RHCSA 04 - 进程管理

架构训练毕业设计+总结
随机推荐
The difference between bagging and boosting in machine learning
User defined path and file name of Baidu editor in laravel admin
Rhcsa-- day one
RHCSA 07 - 用户与群组管理
laravel admin里百度编辑器自定义路径和文件名
JS实现文字滚动 跑马灯效果
Evolution of MySQL database architecture
Global exposure and roller shutter exposure of industrial cameras
leetcode刷题:二叉树06(对称二叉树)
The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO
Understand the principle of bytecode enhancement technology through the jvm-sandbox source code
Leetcode skimming: binary tree 07 (maximum depth of binary tree)
深度优先搜索简要讲解(附带基础题)
There is a problem that the package cannot be parsed in the like project
Redis:有序集合zset类型数据操作命令
How to dynamically cache components in Vue multi-level route nesting
Lnk2038 detected a mismatch of "runtimelibrary": the value "md_dynamicrelease" does not match the value "mdd_dynamicdebug" (in main.obj)
Huawei cloud Kunpeng engineer training (Guangxi University)
[csrf-01] basic principle and attack and defense of Cross Site Request Forgery vulnerability
Perf simple process for multithreaded profile