Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode error: "Command Python resulted in an error (comand 'python.setInterpreter' not found)

I started using venvs on Visual Studio Code, and when I am trying to use pandas, by import pandas

it gives me this error

"Import "pandas" could not be resolved from source"

So I tried to use ctrl+shift+p to change python interpreter in vscode, I get this error

"Command Python resulted in an error (comand 'python.setInterpreter' not found).

like image 251
Ulises Albanés Avatar asked Sep 12 '25 15:09

Ulises Albanés


2 Answers

For me, shifting from restricted mode to trusted window mode worked.

Just click on the restricted window on the bottom and just select "Trust" in the pop up window.

https://code.visualstudio.com/docs/editor/workspace-trust#_extensions

like image 66
Suchint Avatar answered Sep 15 '25 06:09

Suchint


In my case, I solve it by clicking the "Extensions" button in the left sidebar of VSCode and "Reload" python. (which will show a blue reload button in the lower left corner of Python's block, just click it)

It works for me!!

like image 36
wen Avatar answered Sep 15 '25 06:09

wen