Setting up Python and PyMYSQL on your MAC | Run Python on XAMPP or Apache

1. Download and Install XAMPP – make sure MySQL and Apache is running

2. Python – download and install it at
3. Edit http.conf in your apache. Find: AddHandler cgi-script .cgi .pl .asp and add .py and save
4. Instal PIP in your machine

– download

Copy the code and put it somewhere in your computer.. and then go to file location via terminal.. then run following command:

sudo python

5. Then lastly install PyMYSQL

type this command: pip install PyMysql

6. Then restart your apache and Mysql ...  Read More

Share This: