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

3
  • did you install pymysql? Commented May 4, 2019 at 12:57
  • Possible duplicate of No module named 'pymysql' Commented May 4, 2019 at 12:57
  • @Vanz How can I check the duplicate for the same Commented May 4, 2019 at 13:16

3 Answers 3

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
Sign up to request clarification or add additional context in comments.

Comments

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

2 Comments

Thanks for feedback!! But I am still facing the same error
are you using virtual environment? try installing it there.
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.