问题解决 _mysql.c(42): fatal error C1083: 无法打开包括文件: “config-win.h”: No such file or directory

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

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/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
    ERROR: Command errored out with exit status 1:
     command: 'D:\AllCodeFile\pythoncode\LegalProvisions\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ xxxxx\\AppData\\Local\\
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值