问题
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