pycharm运行的时候出现module 'sys' has no attribute 'setdefaultencoding'错误的解决方法

运行代码的时候出现了module 'sys' has no attribute 'setdefaultencoding'错误,在网上试了很多方法都不行,最终发现删掉external libraries-site-packages里面的sitecustomize.py文件就行了。

因为之前在网上试了如下的方法:


但是python3不支持这个setdefaultencoding这个语句,所以才导致了报错,所以删掉那个文件就行了。

猜你喜欢

转载自blog.csdn.net/autotest00/article/details/79570393