In order to run python with the specified version of python itself and versions of various packages, it is necessary to switch the environment of python. "conda" manages switching python environments in Anaconda.
No special setting is required. Select "Start" → ""Anaconda3 (64-bit)" → "Anaconda Prompt" at the "start menu" to start it. A new window is displayed, and at the prompt you will see the name of the python environment. The environment name is "base" in the following example.
No speical setting is required. Select "Start" → ""Windows System Tools" → "Command Prompt" at the "start menu" to start it. When you activate without specifying the python environment, the base environment is activated.
The name of the activated python environment is displayed at the beginning of the prompt.
C:\Users\nitta> conda activate (base) C:\Users\nitta> conda activate (base) C:\Users\nitta> conda activate gpu (gpu) C:\Users\nitta>
When Anaconda is installed in "C:/sys/Anaconda3" on the Windows OS, it appears as "/cygdrive/c/sys/Anaconda3" in the cygwin shell. Hereinafter, the path is expressed as $(ANACONDA).
Set conda's environment so that $(ANACONDA)/etc/profile.d/conda.sh is executed automatically when bash is executed. There are two ways.
in the cygwin window started with "Run as administrator" ln -s $(ANACONDA)/etc/profile.d/conda.sh /etc/profile.d
Set conda's environment so that $(ANACONDA)/etc/profile.d/conda.csh is executed automatically when bash is executed. There are two ways.
in the cygwin window started with "Run as administrator" ln -s $(ANACONDA)/etc/profile.d/conda.csh /etc/profile.dType the following to activate python_env_name.
C:\Users\nitta\Documents\jupyter> conda activate python_env_nameThe behavior of "deactivate" may be slightly strange.