import MySQLdb UserWarning
import MySQLdb
2023-09-11 14:20:46 时间
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
╭─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文件夹中;但我在当前文件夹也存在同样的模块,所以可能会反复导入。
仅仅要切换到其它文件夹执行就能够了。
相关文章
- Spring中@Import注解的作用和使用(转)
- [Javascript] Global import
- import 其他文件
- reactjs通过lazy函数配合import函数动态加载路由组件
- SAP SEGW 事物码里的 Function Import
- Atitit import sql fun 重要的sql功能扩展 ext 目录 1.1. Insert merge1 1.2. Insert set1 1.2.1. 13.2.5. LOAD
- 成功解决ImportError: cannot import name ‘adam‘ from ‘tensorflow.python.keras.optimizers‘
- vue3 - import js文件eslint报错-解决
- Python中 “from docx import Document”报错
- vite配置vite-plugin-style-import插件后启动报错
- WordPress Import 上传的文件尺寸超过php.ini中定义的upload_max_filesize值-->解决方法。
- from lxml import etree报错
- pip安装iterstrat.ml_stratifiers import MultilabelStratifiedKFold, MultilabelStratifiedShuffleSplit
- pycharm引入其他目录的包报错,import报错