码迷,mamicode.com
首页 > 数据库 > 详细

import MySQLdb UserWarning

时间:2015-07-18 18:39:55      阅读:325      评论:0      收藏:0      [点我收藏+]

标签:

Finished processing dependencies for MySQL-python==1.2.5
╭─haoke@haokedeMBP ~/ProgramFiles/MySQL-python-1.2.5
╰─$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
/Library/Python/2.7/site-packages/MySQL_python-1.2.5-py2.7-macosx-10.10-intel.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.7/site-packages/MySQL_python-1.2.5-py2.7-macosx-10.10-intel.egg/_mysql.pyc, but /Users/haoke/ProgramFiles/MySQL-python-1.2.5 is being added to sys.path

>>> exit();


原因是,install后MySQLdb模块已经被放到python的site-pachages目录中;但我在当前目录也存在相同的模块,所以可能会重复导入。只要切换到其他目录运行就可以了。

版权声明:本文为博主原创文章,未经博主允许不得转载。

import MySQLdb UserWarning

标签:

原文地址:http://blog.csdn.net/pcyph/article/details/46943911

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!