how to use anaconda python in command prompt

Question:

I learned from other posts that in order to use python installed by anaconda, I need to set up environmental variable shown below. As you can see, I put C:UsersRT008840Anaconda3python.exe and C:UsersRT008840Anaconda3Scripts at the top among other variables.
enter image description here

However, when going back to the command prompt with where python, the output is still C:UsersRT008840AppDataLocalMicrosoftWindowsAppspython.exe instead of my python path from anaconda C:UsersRT008840Anaconda3python.exe
Any missing steps here? Thanks.
enter image description here

P.S. The reason I want to run python in the command prompt is that I will have to run some python scripts in the SQL Server 2008 in the future with xp_cmdshell that suggested from here.

Asked By: Pete

||

Answers:

I think, you need to use Anaconda prompt instead of normal command prompt

Answered By: Ajay A

Removepython.exe from the path. Only the folder location is needed.
To verify this location, open the anaconda prompt and then use where python. It detects the correct python location.
Also I don’t think that keeping the path at the top is mandatory, it will work even if it is not on the top.

Answered By: Pushkar

You can simply add to the bin folder path to the PATH environment variable.
It will be like:

C:Users<user_name>anaconda3Librarybin

After adding path to the environment variable, you cam simply type conda on your local command line and it will work.

  • use set PATH=%PATH%;C:Users<user_name>anaconda3Librarybin in your current command prompt
  • Use your computer settings to do that forever

This worked for me.

Answered By: Mayuresh Gawai
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.