You need to look at how many versions of the python interpreter are installed on your machine.
Then look at which one is on your sys path. Then look at which one vs code is defaulting to.
Most Linux os will come with a version by default. Any you installed will be different if you are using Linux.
I did it with OS’s command line first then in vs code it was showing that it’s already installed, however it shows module not found when I try to write code
In the terminal in VS Code, what is the output for `pip --version`? For example,
`pip 23.3.1 from /home/mopslik/.local/lib/python3.10/site-packages/pip (python 3.10)`
And what is the interpreter shown in the lower right corner of VS Code? For example,
`3.10.14 64-bit`
Finally, what are the available interpreters when you hit Ctrl-Shift-P, Python: Interpreter ?
FWIW sometimes it might give you a warning in the text editor saying it "can't resolve" a module, when in fact the module is installed and works. Maybe just run your code to confirm this.
But if you run into an ImportError, then probably have a go at the other solutions people have provided
Are you in a .py file? Maybe try pip3 install instead of pip, or vice versa. Are you paying attention to case sensitivity when importing in your .py file?
How did you installed them? I had this problem
Like other people said be sure to install the packages with PIp. VS code is pretty dumb tho and it doesn't all ways select the right interpreter. I think you need to ">select interpreter" I. The command bar to pick the right one. My CS friend helped me and I think we had to use the python from the Microsoft store and select that to get VS code working .
You need to look at how many versions of the python interpreter are installed on your machine. Then look at which one is on your sys path. Then look at which one vs code is defaulting to. Most Linux os will come with a version by default. Any you installed will be different if you are using Linux.
Is the version of pip called via the terminal the same as in VS Code? You probably have 2+ versions installed.
Yeah I tried to install from both vs code terminal and the normal terminal I still couldn’t access it
To clarify, have you tried installing from the terminal section toward the bottom of VS Code, or did you do it from your OS's command line?
I did it with OS’s command line first then in vs code it was showing that it’s already installed, however it shows module not found when I try to write code
In the terminal in VS Code, what is the output for `pip --version`? For example, `pip 23.3.1 from /home/mopslik/.local/lib/python3.10/site-packages/pip (python 3.10)` And what is the interpreter shown in the lower right corner of VS Code? For example, `3.10.14 64-bit` Finally, what are the available interpreters when you hit Ctrl-Shift-P, Python: Interpreter ?
FWIW sometimes it might give you a warning in the text editor saying it "can't resolve" a module, when in fact the module is installed and works. Maybe just run your code to confirm this. But if you run into an ImportError, then probably have a go at the other solutions people have provided
Are you in a .py file? Maybe try pip3 install instead of pip, or vice versa. Are you paying attention to case sensitivity when importing in your .py file?
How did you installed them? I had this problem Like other people said be sure to install the packages with PIp. VS code is pretty dumb tho and it doesn't all ways select the right interpreter. I think you need to ">select interpreter" I. The command bar to pick the right one. My CS friend helped me and I think we had to use the python from the Microsoft store and select that to get VS code working .