0

I have a program that I want to have run automatically on a remote virtual machine. All is going well until I try to install mysqldb using the command pip install mysql-python.

I have downloaded and installed MS Visual Studio from here.
I have tried to download and install the python connector for Windows x86 64 bit here however I am using python version 3.6 and it won't let me install it or the 2.7 version.

Solutions I have reviewed on this site are:
"Cannot open include file: 'config-win.h': No such file or directory" while installing mysql-python
mysql-python install fatal error
error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\link.exe' failed with exit status Install mysql module for python with pip

What else can I do? This is the last of the imports that I need in order to get the program to run on the virtual machine.

_mysql.obj : error LNK2001: unresolved external symbol mysql_autocommit
_mysql.obj : error LNK2001: unresolved external symbol mysql_error
_mysql.obj : error LNK2001: unresolved external symbol mysql_thread_id
LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup
build\lib.win-amd64-3.6\_mysql.cp36-win_amd64.pyd : fatal error LNK1120: 56

unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120

----------------------------------------
Command ""c:\program files\python36\python.exe" -u -c "import setuptools, tokeni
ze;__file__='C:\\Users\\mnickey\\AppData\\Local\\Temp\\2\\pip-build-vknr34ta\\my
sql-python\\setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().
replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install -
-record C:\Users\mnickey\AppData\Local\Temp\2\pip-ulpqiu5q-record\install-record
.txt --single-version-externally-managed --compile" failed with error code 1 in
C:\Users\mnickey\AppData\Local\Temp\2\pip-build-vknr34ta\mysql-python\
mnickey
  • 727
  • 1
  • 6
  • 15

1 Answers1

0

Either chose a binary installer built exactly for your OS and Python version or use the source and compile it.

Otherwise, there's an non official binary MySQL connector for Python 3.6 and Windows here : https://pypi.python.org/pypi/mysqlclient

glenfant
  • 1,298
  • 8
  • 9
  • I thought that I had mentioned that as one of the previously tried steps. I have tried selecting both my python version and my OS (64bit and 32 bit) but this still has not worked. The Mysqlclient is also not working. However since this is a virtual machine, all privileges and installs have been reset. I'll have to try again but thanks for the try. It should be noted that when trying to install via a .whl, the message returned is that this is not a supported wheel on this system. – mnickey Oct 09 '17 at 15:51