python-module 'pymysql' has no attribute 'connect'
2016-06-03 11:45
435 查看
这两天搞python爬虫,想着把爬下来的数据放到mysql中-然后查到了pymysql
第一步肯定去找官方文档咯-戳我去github
然后install--sample-想着这难不倒我啊
copy sample进去连接本地mysql--结果蛋疼了,module 'pymysql' has no attribute 'connect'
难道没安装成功?点击也能看源码啊-我草,官方文档还能坑人?Google中-发现了这个
Error
这是下面的回答:
You've called some other module "pymysql". Look for a file named "pymysql.py" and rename it, and remove any associated .pyc file.
慢着--我擦,名字起错了!错了!了!!!---不要起import的包名作为文件名啊!
好吧,我承认我是来搞笑的!
第一步肯定去找官方文档咯-戳我去github
然后install--sample-想着这难不倒我啊
copy sample进去连接本地mysql--结果蛋疼了,module 'pymysql' has no attribute 'connect'
难道没安装成功?点击也能看源码啊-我草,官方文档还能坑人?Google中-发现了这个
Error
conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='', db='pymysql') AttributeError: 'module' object has no attribute 'connect'
这是下面的回答:
You've called some other module "pymysql". Look for a file named "pymysql.py" and rename it, and remove any associated .pyc file.
慢着--我擦,名字起错了!错了!了!!!---不要起import的包名作为文件名啊!
好吧,我承认我是来搞笑的!
相关文章推荐
- 解决在Windows server 2008 安装Python2.7版本
- numpy常用函数
- Python configparser模块
- python urllib2
- python爬虫基础A
- python中的@符号的作用
- python 基本语法
- Python NLTK学习
- PYTHON 自定义异常类的使用
- Python的静态方法和类方法有什么区别
- Python 输出文字带颜色
- 命令形式新建第一个python 项目
- Python函数式练习
- 小强IT游记之大连行
- adaboost算法
- 小强IT游记之厦门行
- Python常用模块之sys
- python内置函数每个执行一次
- python 2与3的区别汇总
- python GIL 全局锁