python的一些报错解决

python的一些报错解决,第1张

问题一:AttributeError:'module' has no attribute 'xxx'的解决方法

搜索对应的文件下的缓存文件 __pycache__

删除即可。

场景一:NameError: name 'requests' is not defined

解决方案:没有import或者没有 install

import requests

场景二:ModuleNotFoundError: No module named 'duanxin'

linux下面添加下面前面两行就可以导入了

import sys
sys.path.append('/opt/data/pythonshsz')
from duanxin.duanxinapi import send_sms

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

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

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

发表评论

登录后才能评论

评论列表(0条)

    保存