1

I am using PyCharm and I'm trying to make a simple script that connects to a database.

In the PyCharm terminal, both mysqlclient installations from here seem to fail.

(venv) C:\Users\erics\CS261>pip install mysqlclient-1.4.6-cp38-cp38-win_amd64.whl
mysqlclient-1.4.6-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

(venv) C:\Users\erics\CS261>pip install mysqlclient-1.4.6-cp38-cp38-win32.whl
mysqlclient-1.4.6-cp38-cp38-win32.whl is not a supported wheel on this platform.

In Windows's terminal, they are succesfully installed:

C:\Users\erics>pip install mysqlclient-1.4.6-cp38-cp38-win32.whl
Processing c:\users\erics\mysqlclient-1.4.6-cp38-cp38-win32.whl
Installing collected packages: mysqlclient
Successfully installed mysqlclient-1.4.6

Even though it is "succesfully installed", my script does not seem to run...

C:\Users\erics\CS261\venv\Scripts\python.exe C:/Users/erics/CS261/venv/Scripts/test.py
Traceback (most recent call last):
  File "C:/Users/erics/CS261/venv/Scripts/test.py", line 1, in <module>
    import MySQLdb
ModuleNotFoundError: No module named 'MySQLdb'

Process finished with exit code 1
Eric
  • 175
  • 1
  • 13
  • 1
    Hi Eric! What version of Python are you using? Could you try some of the solutions given on [this question](https://stackoverflow.com/questions/454854/no-module-named-mysqldb)? – Ivanhercaz Feb 16 '20 at 16:10
  • hello @Ivanhercaz, I am using Python 3.8, I tried ```pip install mysqlclient```, but with no success – Eric Feb 16 '20 at 16:15
  • ```MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2 ``` – Eric Feb 16 '20 at 16:15

0 Answers0