Argent
Argent

Reputation: 29

Python 3.8.5 and MYSQLDB

As of late, I have been attempting to setup MySQLDB on Pycharm. I have Python 3.8.5 installed, have made sure the PATH is set, and everything seems to be working handily. After this, I ran the pip command.

python -m pip install mysqldb and python -m pip install mysqldb-python

But to no avail.

I tried to install it from Pycharm's interpreter page, but also no dice. I also attempted to install using a .whl file, but that has also turned out a failure. I've searched far and wide for the last few days, and I've found mention of this error, but none of the fixes I've seen have truly worked. The error I get is the same, regardless of which iteration I attempt to install. And of all the guides I see, I never see any mention of steps I've missed or things I should have done before attempting an installation aside from what I've done. The error is as follows.

ERROR: Could not find a version that satisfies the requirement MySQLdb (from versions: none)
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Could not find a version that satisfies the requirement MySQLdb (from versions: none)
ERROR: No matching distribution found for MySQLdb

Upvotes: 2

Views: 7126

Answers (2)

Ahmad Waqar
Ahmad Waqar

Reputation: 494

you can try installing the following,

pip install pymysql
pip install mysql-connector
pip install mysql-connector-python

or you can go to lfd.uci.edu/~gohlke/pythonlibs/#mysql-python and install the wheels.

Upvotes: 3

343GuiltySpark
343GuiltySpark

Reputation: 3

It looks like you're using the wrong package to try to install mysqldb through pip. I tried it and got the same error you did this tells me that pip is looking for a package to download and install, but cannot find it.

Try this instead:

pip install MySQL-python

You can learn more about this package here: https://pypi.org/project/MySQL-python/#description

Upvotes: 0

Related Questions