Python: MySQLdb on Windows virtualenv (w. figures)

If you have a virtualenv on Windows and you want to add MySQLdb support via mysql-python, read this before spending hours of your life to figure why it doesn’t and it will never work.

1) Install MySQL for Python selecting the same Python version of the virtualenv

Install MySQL for Python

python-mysql-win

2) From site-packages directory above, copy the selected files:

python-mysql-mysqldb

3) (optional) On PyCharm, look for virtualenv site-packages inside the path marked with the arrow:

pycharm-virtualenv

4) Open your virtualenv console ad do:

MySQL for Python is now installed on your virtualenv.

Linux: MySQLdb on virtualenv with –no-site-packages

How to Install MySQLdb in PyCharm, Windows

Linux: MySQLdb on virtualenv with –no-site-packages

 

https://web.archive.org/web/20170301000000*/https://sourceforge.net/projects/mysql-python/

https://web.archive.org/web/20170301000000*/https://chirale.wordpress.com/2017/03/01/python-mysqldb-on-windows-virtualenv-w-figures/python-mysql-win/

https://web.archive.org/web/20170301000000*/https://chirale.wordpress.com/2017/03/01/python-mysqldb-on-windows-virtualenv-w-figures/python-mysql-mysqldb/

https://web.archive.org/web/20170301000000*/https://chirale.wordpress.com/2017/03/01/python-mysqldb-on-windows-virtualenv-w-figures/pycharm-virtualenv/

https://web.archive.org/web/20170301000000*/http://stackoverflow.com/a/31866350

https://web.archive.org/web/20170301000000*/https://chirale.org/2017/03/21/linux-mysqldb-on-virtualenv-with-no-site-packages/

Proxied content from gemini://chirale.org/2017-03-01_3528.gmi (external content)

Gemini request details:

Original URL
gemini://chirale.org/2017-03-01_3528.gmi
Status code
Success
Meta
text/gemini; charset=utf-8
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.