💾 Archived View for chirale.org › 2017-03-01_3528.gmi captured on 2024-05-12 at 15:17:38. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

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:

 import MySQLdb 

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/