0

I have tried using pip install mysqlclient and it says

Requirement already satisfied: mysqlclient in c:\program files\python37\lib\site-packages (1.3.12)

I have MySQL installed with the connector as well

but when i try to pip install MySQL-python

It Throws an error. it says Failed building Wheel for MySQL-python... it also throws this exception

try: import MySQLdb as Database except ImportError as err: raise ImproperlyConfigured( 'Error loading MySQLdb module.\n' 'Did you install mysqlclient?' ) from err

When i try to migrate the database, it doesnt migrate because it says mysql is not linked...

14
  • From your path it looks like you are running Python 3.7. Is that the case? mysqlclient might not yet work with this pre-release development version Commented May 23, 2018 at 5:57
  • When i went to File-> Settings->Project Interpreter, it says python 3.6 Commented May 23, 2018 at 6:06
  • Ok, it was just a guess as your path says python37. Does the mysqlclient package show up in the list of packages in File -> Settings -> Project Interpreter (assuming you are using PyCharm as IDE)? Commented May 23, 2018 at 6:14
  • Ive installed Mysqlclient using pip install C:\inetpub\wwwroot\BugTracker\mysqlclient-1.3.12-cp37-cp37m-win_amd64.whl And it said that it already exists. And yes, i use PyCharm, and When i got to the project interpreter, it shows "Django 2.0.5, mysql-connector-python 8.0.11, pip 9.0.1, pytz 2018.4, setuptools 28.8.0 Commented May 23, 2018 at 6:19
  • Huh? The name of the .whl says cp37 ... This is what I would expect in the name of the wheel for Python 3.7. This version does not even show up for me on pypi.org. Where did you get it from? If you are running Python 3.6 and have a mysqlclient package installed that was built for python 3.7, this might in fact cause your issue. Commented May 23, 2018 at 6:31

1 Answer 1

2

python37 doesn't support mysql yet.

Try this:

python3 -m pip install PyMySQL

Requirements

Python – one of the following:

  • CPython >= 2.7 or >= 3.4
  • Latest PyPy
  • MySQL Server – one of the following:
  • MySQL >= 5.5
  • MariaDB >= 5.5

https://pymysql.readthedocs.io/en/latest/user/installation.html

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.