0

Facing below error "ModuleNotFoundError: No module named 'pymysql'"

import os
import pymysql
import pandas as pd

host = os.getenv('MYSQL_HOST')
port = os.getenv('MYSQL_PORT')
user = os.getenv('MYSQL_USER')
password = os.getenv('MYSQL_PASSWORD')
database = os.getenv('MYSQL_DATABASE')

Need assistance as I am new to this.

enter image description here

enter image description here

Pawan
  • 563
  • 1
  • 6
  • 19

3 Answers3

1

This issue got fixed. I installed pymysql and mysql-connector using anaconda prompt.

  1. Open Anaconda Prompt
  2. pip install mysql-connector
  3. pip install pymysql
Pawan
  • 563
  • 1
  • 6
  • 19
0

make sure it's installed.

run this in terminal/cmd:

windows

$ python3 -m pip install PyMySQL

or simply:

pip install PyMySQL

linux

$ sudo apt-get install python3-pymysql
Evan
  • 2,327
  • 5
  • 31
  • 63
0

I fixed this on my pc too it took me 1 day :) So go to your cmd or terminal and write : pip uninstall pymysql

python -m pip --upgrade pip pip install pymysql

This will fix it as the version of pip u are using cant build a wheel for the module