运行python程序时,也许会出现这样的错误:AttributeError: module ‘xxx’ has no attribute ‘xxx’: 
解决该错误有两种方法

1、手动安装该模块

2、检查文件名

这个方式看起来很傻,但是却是新手经常会犯的错,原因是因为自己的文件名称和要使用的模块重名了,只需要更改文件名即可。

 

python出现AttributeError: module ‘xxx’ has no attribute ‘xxx’错误时,两个解决办法的更多相关文章

  1. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  2. python 提示 AttributeError: module 'json' has no attribute 'dumps'

    最近在学习python解析json的时候遇到问题, 提示 AttributeError: module 'json' has no attribute 'dumps' (模块没有dumps属性的意思) ...

  3. 【Python 脚本报错】AttributeError: 'module 'yyy' has no attribute 'xxx'的解决方法

    先参考这篇记录大概理解了原因, 再深入了解下python的import机制, 发现自己的模块之间存在互相import. 比如,A.py中import B,而B.py中也import A了, 现在执行模 ...

  4. 运行pytest,报错"AttributeError: 'module' object has no attribute 'xxx'"

    最近学习pytest被此问题困扰,敲脑壳,实在是不该.百度解决方法一大堆,我的问题怎么也解决不了,来看一下,我是怎么解决的,各位大佬勿喷,只是自己做笔记用,谢谢. 报错信息如下: 网上解决方法是这样的 ...

  5. python 脚本运行时报错: AttributeError: 'module' object has no attribute ***

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  6. 在运行create_list.sh时候报错:AttributeError: 'module' object has no attribute 'LabelMap'

    Traceback (most recent call last):File "/opt/xuben-project/caffe/data/VOC0712/../../scripts/cre ...

  7. Python AttributeError: 'Module' object has no attribute 'STARTF_USESHOWINDOW'

    夫学须志也,才须学也,非学无以广才,非志无以成学.--诸葛亮 生活有度,自得慈铭 --杜锦阳 今天新来的同事安装环境遇到个莫名其妙的问题: AttributeError: 'Module' objec ...

  8. python中提取位图信息(AttributeError: module 'struct' has no attribute 'unstack')

    前言 今天这篇博文有点意思,它是从一个例子出发,从而体现出在编程中的种种细节和一些知识点的运用.和从前一样,我是人,离成神还有几十万里,所以无可避免的出现不严谨的地方甚至错误,请酌情阅读. 0x00 ...

  9. python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?

    python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...

随机推荐

  1. javascript中的数据渲染与提取

    table数据 <div id="tableDiv" style="overflow-x: scroll"> <table class=&qu ...

  2. 虚拟机Linux下扩展硬盘的方法

    [原文链接]:http://blog.csdn.net/tianlesoftware/article/details/5642883 装虚拟机时空间划小了,于是又加了5G的空间,折腾了半天,挂上去了. ...

  3. VMware虚拟化集群的配置(一)

    一.VMware介绍 VMware vSphere 是业界领先且最可靠的虚拟化平台.vSphere将应用程序和操作系统从底层硬件分离出来,从而简化了 IT操作. VMware集群最主要的两个部分ESX ...

  4. 垃圾回收gc --翻译

    原文在https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management.基本保持了平译,并在一些地方做了概念解释.(转 ...

  5. Zen Cart 常用SQL命令

    网店日常维护过程中,难免要跟各种批量操作打交道, 虽然大多数操作可以通过批量上传 (easy populate) 和 快速更新 模块来完成, 但在应用便捷性和一些功能性的调整上, 总有一定的局限性; ...

  6. 页面内置函数${fn:}

    引入头文件<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions " %&g ...

  7. 第二章 Vue快速入门-- 15 vue中通过属性绑定为元素设置class类样式

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  8. shell_hive

    (1)获取参数:从shell文件传来参数,调用:$1,$2,$3 load_date=$1 clearn_date=`date -d"$2 day ago $load_date" ...

  9. 使用rpm安装mysql5.6(简单安装 实验使用)

    [root@localhost mysql]# cd /usr [root@localhost mysql]# mkdir mysql [root@localhost mysql]# cd mysql ...

  10. web性能优化-浏览器工作原理

    要彻底了解web性能优化的问题,得搞清楚浏览器的工作原理. 我们需要了解,你在浏览器地址栏中输入url到页面展示的短短几秒中,浏览器究竟做了什么,才能了解到为什么我们口中所说的优化方案能够起到优化作用 ...