primo
primo

Reputation: 1472

ImportError: No module named PyMySQL

I have installed python 3 using this command

sudo apt-get install python3-minimal

after that I have downloaded python extension in vs code. I want to connect it to mySql database but as I write

import PyMySQL

It shows this stack trace

Unable to import 'PyMySQL'pylint(import-error)

Upvotes: 1

Views: 486

Answers (1)

Sergi Pasoevi
Sergi Pasoevi

Reputation: 2851

You need to also install python3-pymysql

sudo apt-get install python3-pymysql

And your import should be lowercase:

import pymysql

EDIT: Make sure that you have started the same python interpreter from the same installation (check version displayed in python prompt when starting)

Upvotes: 3

Related Questions