Project scenario: anaconda prompt starts the default %HOME%
The anaconda virtual environment is installed on the D drive. anaconda prompt
When starting the command line mode, the default working directory is: c:\User\Administrator
. The source code installation package or code file is usually not in the C drive, so running the program through the command line will require you to switch to this working path.
However, commands to switch to other disks, such as cd E:\
, do not take effect.
Solution: Modify the start path of anaconda prompt
The specific solution is as follows:
Step 1: Open the Windows start menu, find anaconda prompt
, right-click, and open the file location.
Step 2: Right-click Anaconda Prompt (Anaconda3)
the shortcut, click Properties, and modify it 起始位置
to the working directory you want to switch.
Restart anaconda prompt
the command mode and switch to this path.