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.
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.
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.
Answers:
I think, you need to use Anaconda prompt
instead of normal command prompt
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.
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.
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.
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.
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.
I think, you need to use Anaconda prompt
instead of normal command prompt
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.
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.