繁体   English   中英

python 3.5.2:`pip install mysqlclient`错误

[英]python 3.5.2 : `pip install mysqlclient` error

我的操作系统是win 10 x64 ,python是3.5.2
我安装mysqlclient通过pip install mysqlclient
有一些错误,如下所示:

D:\demo>pip install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-1.3.7.tar.gz
Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient ... error
    Complete output from command c:\users\dell\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\dell\\AppData\\Local\\Temp\\pip-build-95hytmeq\\mysqlclient\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\dell\AppData\Local\Temp\pip-wv5bnfnn-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.5
    copying _mysql_exceptions.py -> build\lib.win32-3.5
    creating build\lib.win32-3.5\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\compat.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\release.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\times.py -> build\lib.win32-3.5\MySQLdb
    creating build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.5\MySQLdb\constants
    running build_ext
    building '_mysql' extension
    creating build\temp.win32-3.5
    creating build\temp.win32-3.5\Release
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,7,'final',1) -D__version__=1.3.7 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -Ic:\users\dell\appdata\local\programs\python\python35-32\include -Ic:\users\dell\appdata\local\programs\python\python35-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tc_mysql.c /Fobuild\temp.win32-3.5\Release\_mysql.obj /Zl
    _mysql.c
    _mysql.c(29): fatal error C1083: Cannot open include file: 'my_config.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\users\dell\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\dell\\AppData\\Local\\Temp\\pip-build-95hytmeq\\mysqlclient\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\dell\AppData\Local\Temp\pip-wv5bnfnn-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\dell\AppData\Local\Temp\pip-build-95hytmeq\mysqlclient\

我该怎么办?

尝试从此链接下载适用于Windows和python配置的.whl文件

然后使用命令安装该.whl文件

pip install /path/to/your/.whl file/some-package.whl

这发生在我身上:(py352)C:\\ pyvenv> pip install mysqlclient-1.3.7-cp27-none-win_amd64.whl(enter)Salida:不支持mysqlclient-1.3.7-cp27-none-win_amd64.whl在这个平台上转动。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM