1

Hi,

Im trying to pip install mysql-python and I keep getting an error. I was wondering if anyone knows what I need to do get this working?

I'm using Windows 10, python 3.6 and mysql 5.7. I'm new to coding so if there is something I missed please let me know. Thanks

This is the error I keep getting:

_mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x64\cl .exe' failed with exit status 2

4
  • I suggest you to use PyMySQL instead on windows, also u can use mysqlclient Commented Mar 10, 2018 at 4:44
  • Would I still be able to write and pull data from MySQL using this method? I was trying to follow a text book for my first example. Commented Mar 10, 2018 at 4:52
  • Yes you'll be able to do that! Check this link Commented Mar 10, 2018 at 4:54
  • Possible duplicate of Can't install mysql-python (newer versions) in Windows Commented Sep 27, 2018 at 0:53

1 Answer 1

0

You can download unofficial windows binaries for your python version using https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient.Then install it using pip. This way you'll be able to avoid the hassle of dealing with visual studio build tools.

Just download the mysqlclient.whl file most applicable to you(for python 3 versions).

I think in your case it'll be

mysqlclient‑1.3.13‑cp36‑cp36m‑win32.whl(if your machine is 32 bits) mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl(if your machine is 64 bits)

and then in command prompt, change the location to the directory where the downloaded file is, by :

cd "the path to the downloaded file"

and run the file:

pip install mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.