Python: Making Conda Accessible in cmd Without Accessing Python Through the Default Environment
Benefits of Doing This
Normally, after installing miniconda, the system picks up miniconda’s base environment as the default environment and can directly use base to run python. This makes the base environment very easy to contaminate
What I need now is for cmd to access the conda command normally, but not python
Step 1
Make sure Python is not installed in the machine’s main environment. Download and install miniconda, choose just me during installation, and do not set environment variables
Step 2
Open a cmd window and enter the absolute path to perform conda init
C:\Users\mengzhishanghun\miniconda3\Scripts\conda.exe init cmd.exe
Open a new cmd window, and you will find that cmd now correctly recognizes conda commands
Step 3
Now enter
conda config --set auto_activate_base false
This disables entering the base environment by default. Now enter where python, and the result is
C:\Users\mengzhishanghun>where python
信息: 用提供的模式无法找到文件。
Thanks for reading. Feel free to like, follow, and bookmark, and discuss any questions in the comments.
If this article helped you, click here to donate and support the author.