encoding‘ is an invalid keyword argument for this function

encoding‘ is an invalid keyword argument for this function,第1张

error:TypeError: 'encoding' is an invalid keyword argument for this function
  • 首先查看python版本

首先查看python版本
python -V:
python=2.7!  

如果python2.7的话encoding的版本和编码都不匹配需要切换成python3.7环境
(如果有conda环境,直接切换python版本为3.7的环境 – conda activate XXX)

pip uninstall python==2.7  or conda uninstall python==3.7

使用pip list 查看是否卸载成功

pip list  or conda list    

如果list中无python版本

pip install python==3.7   or   conda install python==3.7

再次使用list查看环境中python版本

如果python版本切换成功

这时运行程序,程序正常运行。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/876182.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存