Can one setup Python to run in the Windows Command Prompt terminal while Spyder and Anaconda is already installed?

In the context of this video:

More details for context:
My OS is Windows 10 and I have Spyder IDE installed, which also installed Anaconda on my system. I installed Spyder because I wanted to use it for tackling the Censor Dispenser Challenge. It really paid off, especially the “Variable Explorer” which helped me more precisely debug my code.

My issue:
The instructions starts off with opening the command prompt and checking if python is installed using pip. When I open my command prompt and check, I find that python is not installed because it returns “pip not recognized”. It turns out that there is a separate CLI on my computer called Anaconda prompt, and using pip shows me that Python is installed.

  • Since Python is already installed somewhere in my computer, do I just have to make it accessible to the Windows Command Prompt? Or is the Python detected by Anaconda only available in Anaconda and I have to do a separate install of Python as per this Codecademy article?

  • I saw this article on how to setup virtual environments for Spyder/Anaconda. I have to use a different process to setup virtual environments for Spyder and for Windows Command Prompt or Anaconda Prompt?

At the command line level the only interpreter the OS sees is the Python installation of record. Only while in an instance of those IDEs will you be faced with whatever version of Python they installed with, or be able to access the APIs they house.

Bottom line, if your OS knows you have Python, it will give you that API from the command line.

Installing Python as per this article will not interfere with the Python being used by the IDE and vice versa?

I wouldn’t go so far as to say that, but the IDE may have chosen a different location than AppData/… to install Python for its own use. If you install Python from the dot org download location it will likely give you a discreet install. I can’t be sure. If you have an IDE installed, try to find out where Python is installed before proceeding. Also try to find out if you can access that version from the command line (outside of the IDE running) without any more fuss.

1 Like

I found out where the IDE has installed and accesses python:

Entered in Anaconda Prompt:
(base) C:\Users\alex2>where python

It returned:
C:\Users\alex2\anaconda3\python.exe
C:\Users\alex2\AppData\Local\Microsoft\WindowsApps\python.exe

P.S. I should use censor dispenser to censor my user name :stuck_out_tongue_closed_eyes:

That is completely different from where the dot org install would go.

C:\Users\alex2\AppData\Local\Programs\Python\Python38
1 Like

Be sure to install shortcuts on the taskbar. The Python link doesn’t open a text editor. We need to open a file once the shell is open.

I’m fairly confident you’d have installed Anaconda which would then bundle Spyder with it. If I’m not mistaken the maintainers of Spyder no longer support installing it as a standard Python package and only support install via conda (that may have changed). Since it’s installed with conda I’d suggest sticking with the conda environment and using conda install (where possible) instead of pip because the two don’t always mix nicely (the full anaconda even has a GUI for package management- anaconda navigator).

Some details on the install method with a conda environment are available at the following link to the docs-

There’s also a decent guide on the conda docs about setting up virtual environments in conda which might be your easiest route-

A couple of links you may find useful regarding mixing pip with a conda environment-


2 Likes

To add on to @tgrtim’s advice, if you already have Anaconda installed you might as well just use Anaconda Prompt. It is just Windows Command Prompt, but it runs a batch script on start-up to activate your base conda environment.

The only difference between it and Command Prompt for your purposes is that you will want to install your Python packages using conda install rather than pip install wherever you can, since you are doing it inside of a conda environment (base). See the links @tgrtim included for more details on this.

2 Likes