Selecting the correct interpreter to install packages into & use with VSCode on Windows

I have the code I want to run on a roughly 56KB csv excel file.

Until now, I had been using the gdb python compiler. And it functions there but only for like roughly 700-900 cells. Not all the data.

The first issue would be downloading pandas. Which I have done. But this is the issue:

My cmd doesn’t recognize python.3.11 which I downloaded directly from the python site and even copied and pasted the python files and programs into a specific folder under my “Program Files”.

My cmd only recognizes python 3.10, which it got directly from microsoft. (I already talked to microsoft, they said I should talk to python). And so I was able to successfully download pandas on my cmd from Microsoft app’s python 3.10.

Now.

I have no idea where the file is to successfully import python 3.10 as a python interpreter on visual studio code.

Really hoping anyone can offer assistance.

Thank you.

Not specifically relevant to the particular issue you discuss below, but just to note, “CSV” and “Excel” are two totally different formats (families of formats, in fact). CSV is a simple but easy and widely-supported to read and write family of text-based file format, while Excel is one of several binary/XML, proprietary and far more complex to read and write Microsoft-specific formats.

How did you “download pandas”? Exactly what commands did you run, where did you run them and what output did they give? Without specific information, we cannot hope to give specific help without blindly guessing. Please provide your full and complete input and output in a code block, which you can do so with the </> button in the toolbar, or via typing triple backticks above and below the code in question, optionally with the language name (e.g. console) for syntax highlighting, like this:

```console
<YOUR CODE HERE>
```

More or less what’s happening here is when you’re running, e.g. pip install pandas, its installing Pandas in the Windows Store Python or some other Python; you need to run the command with the Python interpreter you want it to install into, e.g. <path/to/python3.11> -m pip install pandas or py -3.11 -m pip install pandas.

Again, to ensure we can give you specific help, you need to tell us specifically what you mean by “doesn’t recognize python 3.11”. What exact commands are you running and where, and what exact output are you getting? Fortunately, this one pretty easy to guess at the likely reason—did you select the option to add the new Python interpreter to your PATH during installation?

If not, typing python will not resolve to that Python. If you did select it, python may be still be resolving to your existing MS Store Python installation instead; you can check to see if both are listed under the output of the command where python.

Now, you could add it to the PATH and/or modify your PATH so that the Python.org 3.11 installation appears first, but there’s no need for that. Instead, if you want to use your Python 3.11 install, use the Python Launcher for Windows like so:

py -3.11

The command

py --list

will display the full list of py-accessable installed Pythons. See the py documentation for more information, and the Installing on Windows page of the official docs for overall help and considerations when installing and running Python on Windows.

I’m not 100% sure what you mean by “import python 3.10 as a python interpreter”, but if you mean you want to select your Windows Store Python to use with VSCode, I googled it and the VSCode official docs displaying the simple way to do this are the first hit. Is that what you want?

1 Like