Getting a 500 internal error when attempting to create an apache/django server that runs on digital ocean. After checking the log.error i can see the error below
import pymysql as db
ModuleNotFoundError: No module named pymysql
Within Terminal…
python --version
Python 3.8.5
sudo apt-get install python3-pymysql
python3-pymysql is already the newest version (0.9.3-2ubuntu3).
pip3 install PyMySQL
Requirement already satisfied: PyMySQL in /usr/lib/python3/dist-packages (0.9.3)
Within Python…
import pymysql as db
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
Any help would be appreciated.
2
Answers
use
python -m pip install pymysql
that used the pip for the Python interpreter you specified as
python
works for me.