attributeError:'module' object has no attribute ** 解决办法
写了一个小脚本,执行的时候报错:
Traceback (most recent call last):
File "F:/test/qrcode.py", line 109, in generateQr
img = qrcode.make(textcontent)
AttributeError: 'module' object has no attribute 'make'
google 后说是生成的.pyc 文件的问题,删除后在运行就可以,但删除.pyc 文件运行还是报错: AttributeError: 'module' object has no attribute 'make'。
又有人说是import 的那个库.pyc 文件也要删除, 好,这次把import库的.pyc 也删除,但依据报错!
无奈改了修改了脚本的文件名,莫名其妙可以执行了,忽然想起,和import标准库命名冲突了
脚本命名为qrcode.py 要引用的库 也是qrcode
解决办法:
重命名脚本文件,不能和要引入的模块名称冲突! 不然导入不是模块而是自己创建的文件!
attributeError:'module' object has no attribute ** 解决办法的更多相关文章
- 解决:pipenv shell报错:AttributeError: 'module' object has no attribute 'run'
利用pipenv shell切换到虚拟环境时,显示报错:AttributeError: 'module' object has no attribute 'run' 可以看到是d:\program\p ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...
- 提示AttributeError: 'module' object has no attribute 'HTTPSHandler'解决方法
今天在新机器上安装sqlmap,运行提示AttributeError: 'module' object has no attribute 'HTTPSHandler' 网上找了找资料,发现一篇文章ht ...
- AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'
/*************************************************************************** * AttributeError: 'modu ...
- AttributeError: 'module' object has no attribute 'X509_up_ref'
主要报错: AttributeError: 'module' object has no attribute 'X509_up_ref' 1 解决办法 卸载再重装pyOpenSSL pip unins ...
- 【Python】【亲测好用】安装第三方包报错:AttributeError:'module' object has no attribute 'main'
安装/卸载第三包可能出现如下问题及相应解决办法: 在pycharm编辑中,使用anconda2更新.卸载第三方包时,出现如下错误: AttributeError:'module' object has ...
- 安装pandas报错(AttributeError: 'module' object has no attribute 'main')
在pycharm中安装pandas出现报错:AttributeError: 'module' object has no attribute 'main', 刚开始以为是pip的版本太旧了,于是乎将其 ...
- python问题:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
AttributeError: 'module' object has no attribute 'SSL_ST_INIT' 问题背景: 下载工具wydomain,安装依赖包以后,出现下图问题. 几经 ...
- AttributeError: 'module' object has no attribute 'main'
本机环境:ubuntu16.04, ros-kinetic $ roscore 报错 Traceback (most recent call last): File , in <module& ...
随机推荐
- SpringMVC基础入门
一.SpringMVC基础入门,创建一个HelloWorld程序 1.首先,导入SpringMVC需要的jar包. 2.添加Web.xml配置文件中关于SpringMVC的配置 1 2 3 4 5 6 ...
- HTML知识点链接
1)<marquee> http://www.jb51.net/shouce/dhtml/objects/MARQUEE.html 2)"i ...
- aspx、ashx、asmx文件处理请求效率比较
人生总是面临着许多抉择许多困惑!作为一名“攻城师”或“程序猿”的我们,工作的时候更是如此.你曾经是否苦恼过在系统中使用哪种文件编写客户端请求最合适或最高效呢?aspx.ashx.asmx到底该如何选择 ...
- Oracle 11g 下载|Oracle 11g 官网下载|Oracle 11g 官网下载 带登录用户和密码
本文转载自 Oracle 11g 下载|Oracle 11g 官网下载|Oracle 11g 官网下载 带登录用户和密码 oracle 下载还需要用户名我自己注册了个方便大家使用下载直接点击提示找不到 ...
- 08.01 签到! js 作用域
js 作用域 : 1.js 没有块作用域 : for (var i = 0;i < 4; i++){ } alert(i) // i = 3 2.js 没有动态作用域: function f1( ...
- 9. javacript高级程序设计-客户端检测
1. 客户端检测 1.1 能力检测 在编写代码之前先检测特定浏览器的能力. 1.2 怪癖检测 怪癖实际上是浏览器实现中的bug 1.3 用户代理检测 通过检测用户代理字符串来识别浏览器.用户代理字符串 ...
- Centos6.5 Openvpn的安装与配置
一.安装准备 ? 1 2 yum -y install openssl-devel openssl yum -y install gcc gcc-c++ 二.OpenVPN服务端安装过程1.lzo下载 ...
- RecyclerView的万能分割线
效果图: 使用方法: 添加默认分割线:高度为2px,颜色为灰色 mRecyclerView.addItemDecoration(new RecyclerViewDivider(mContext, Li ...
- iOS 日常工作之常用宏定义大全
转自:http://www.jianshu.com/p/213b3b96cafe 前言: 在工作中, 很多小伙伴都会在PCH文件定义一些常用的宏,但是又怕写这些简单的宏浪费时间,又有时候忘记怎么定义了 ...
- TFS强制解除签入签出锁定
首先你要知道你服务器的用户名和登录密码 看被别人签出了的文件