Miguel Martins
Miguel Martins

Reputation: 13

how to fix Import Error: No module named... in python with VScode

I am trying to import a module into vsCode. I have attached some photos of my current set up right. Things to note:

enter image description here enter image description here

This results in an import error even though I believe I have taken the correct steps in setting up my python project in vscode. If someone has experienced anything similar can you please provide input on how to solve this issue?

Upvotes: 1

Views: 2769

Answers (2)

Hong Zhao
Hong Zhao

Reputation: 314

Install code-runner and place code below in settings.json folder

    "code-runner.executorMap": {
        "python": "python3 -u",
    }

"python": "(the python version with modules) -u",

Upvotes: 2

Jason Norch
Jason Norch

Reputation: 1

My guess is you never installed the requests module.

You need to do

pip install requests

for Python to find it.

Upvotes: 0

Related Questions