Install mysql module for python with pip

拜拜、爱过 提交于 2019-12-23 00:50:10

问题


I'm trying to install mysql module for python with pip, but I got an error:

mysqlclient.lib(typelib.obj) : error LNK2001: unresolved external symbol __iob_func
mysqlclient.lib(viosslfactories.obj) : error LNK2001: unresolved external symbol __iob_func
mysqlclient.lib(my_winfile.obj) : error LNK2001: unresolved external symbol__iob_func
mysqlclient.lib(my_messnc.obj) : error LNK2001: unresolved external symbol __iob_func
mysqlclient.lib(client.obj) : error LNK2001: unresolved external symbol __iob_func
mysqlclient.lib(my_thr_init.obj) : error LNK2001: unresolved external symbol __iob_func
mysqlclient.lib(my_init.obj) : error LNK2001: unresolved external symbol __iob_func
mysqlclient.lib(default.obj) : error LNK2001: unresolved external symbol __iob_func
build\lib.win-amd64-3.6\_mysql.cp36-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120

回答1:


in windows use python unofficial binaries to install MySQL. use this link and download your requirement python package.

install it using,

pip install ~/Downloads/mysqlclient‑1.3.10‑cp36‑cp36m‑win_amd64.whl

from that link search mysql or mysqlclient‑1.3.10‑cp36‑cp36m‑win_amd64.whl download and install using same pip




回答2:


I got the same error this fixed it for me.

pip install --only-binary :all: mysqlclient


来源:https://stackoverflow.com/questions/45455588/install-mysql-module-for-python-with-pip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!