Python3环境安装 MySQL-python 库操作数据库。
出现报错:_mysql.c(42): fatal error C1083: 无法打开包括文件: “config-win.h”: No such file or directory
# 运行
pip install mysql-python
Command Output:
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting mysql-python
Downloading https://mirrors.aliyun.com/pypi/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108 kB)
Using legacy 'setup.py install' for mysql-python, since package 'wheel' is not installed.
Installing collected packages: mysql-python
Running setup.py install for mysql-python: started
Running setup.py install for mysql-python: finished with status 'error'
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated and has no effect anymore. pip 21.1 will remove support for this functionality. A possible replacement is use the TMPDIR

在Python3环境下安装MySQL-python库时遇到_c(42): fatal error C1083: 无法打开包括文件'config-win.h'的问题。解决方案是改用mysqlclient库,因为MySQL-python仅支持Python2,而python3应使用mysqlclient。如果直接安装失败,可以尝试从第三方库<https://www.lfd.uci.edu/~gohlke/pythonlibs/>下载安装包。
最低0.47元/天 解锁文章
4321

被折叠的 条评论
为什么被折叠?



