Command line issues Moving from Python to Anaconda

I hope someone can help me here.

I have been playing with python for a bit, and up until a few minutes ago I had Python 3.9 installed and a few scripts that I had written working.

I just found something interesting on the net and it seems to be wrapped up tightly in Anaconda and given that Anaconda has python in it, it seemed silly to keep both, so I got rid of python. I did click on the thing to register Anaconda as my default Python 3.9, but opening up a new CMD window and typing python, python was not found…

I went ahead and found where anaconda is installed and saw python so I added that to my path, and now I can get python to kick over. Yippie.

However… I had a few things added to my python (I really need to learn how to use envs to I don’t create one big mess again moving forward, but that is for another day.) I have learned that pip is not part of anaconda, it uses conda. Ok, fine, but I can not find a conda executable to run from the command line.

Was I wrong in assuming that the python in Anaconda can be use like a stand alone version of python? I don’t care what the library package manager is, as long as I can use it.

Can someone please help set me in the right direction? I want to be able to click on my python script and have it run like it used to…

First, get rid of the addition to PATH. Conda/Anaconda handles this by itself.

For Anaconda to work, you must first ‘activate’ an environment. Usually the best way is to use the “Anaconda Prompt” that you find in the start menu. Opening the Anaconda Prompt will activate the ‘base’ environment. From the Anaconda prompt, the ‘python’ command should be available.

To make life easier, you can run conda init once from the Anaconda prompt. Then, you can just open the standard CMD or powershell (in any folder) and run conda activate to activate the base environment.

One annoying thing for this conda init thing is that it will always activate the base environment. You can distable this by using conda config --set auto_activate_base False.

Note: after conda init, you will have the conda command available in any CMD/Powershell window. But, to get python command, you will need to run conda activate first.

1 Like