Issues with conda activate and deactivate in Cygwin

54 Views Asked by At

I am using conda on cygwin and there are some issues when I try to conda activate and deactivate. Furthermore, the cursor goes to the very beginning of the line, where it should be placed after the dollar sign.

huyin@Gang ~ $ conda activate base
: No such file or directory/etc/conda/activate.d/openssl_activate.sh
conda deactivate base
: No such file or directory/Scripts/conda.exe
(base) huyin@Gang ~ $

Here is conda info

huyin@Gang ~ $ conda info

     active environment : None
            shell level : 0
       user config file : C:\Users\huyin\.condarc
 populated config files : C:\Users\huyin\.condarc
          conda version : 24.1.2
    conda-build version : 24.1.2
         python version : 3.11.7.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=x86_64
                          __conda=24.1.2=0
                          __cuda=12.0=0
                          __win=0=0
       base environment : D:\Anaconda  (writable)
      conda av data dir : D:\Anaconda\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch          I2GBZaA0.4.3 c/ltujzM1Z1f84gfqwK4NqFw s/c_CGhzQnPu_eiZDC          administrator : Falseaconda\pkgs
             netrc file : Nonesers\huyin\.conda\pkgs
           offline mode : Falseers\huyin\AppData\Local\conda\conda\pkgs
       envs directories : D:\Anaconda\envs
                          C:\Users\huyin\.conda\envs
huyin@Gang ~ $
               platform : win-64
             user-agent : conda/24.1.2 requests/2.31.0 CPython/3.11.7 Windows/10

Really appreciate any help.

I try conda init and conda init bash

huyin@Gang ~ $ conda init
no change     D:\Anaconda\Scripts\conda.exe
no change     D:\Anaconda\Scripts\conda-env.exe
no change     D:\Anaconda\Scripts\conda-script.py
no change     D:\Anaconda\Scripts\conda-env-script.py
no change     D:\Anaconda\condabin\conda.bat
no change     D:\Anaconda\Library\bin\conda.bat
no change     D:\Anaconda\condabin\_conda_activate.bat
no change     D:\Anaconda\condabin\rename_tmp.bat
no change     D:\Anaconda\condabin\conda_auto_activate.bat
no change     D:\Anaconda\condabin\conda_hook.bat
no change     D:\Anaconda\Scripts\activate.bat
no change     D:\Anaconda\condabin\activate.bat
no change     D:\Anaconda\condabin\deactivate.bat
no change     D:\Anaconda\Scripts\activate
no change     D:\Anaconda\Scripts\deactivate
no change     D:\Anaconda\etc\profile.d\conda.sh
no change     D:\Anaconda\etc\fish\conf.d\conda.fish
no change     D:\Anaconda\shell\condabin\Conda.psm1
no change     D:\Anaconda\shell\condabin\conda-hook.ps1
no change     D:\Anaconda\Lib\site-packages\xontrib\conda.xsh
no change     D:\Anaconda\etc\profile.d\conda.csh
no change     C:\Users\huyin\Documents\WindowsPowerShell\profile.ps1
no change     HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
No action taken.
huyin@Gang ~ $ conda init bash
no change     D:\Anaconda\Scripts\conda.exe
no change     D:\Anaconda\Scripts\conda-env.exe
no change     D:\Anaconda\Scripts\conda-script.py
no change     D:\Anaconda\Scripts\conda-env-script.py
no change     D:\Anaconda\condabin\conda.bat
no change     D:\Anaconda\Library\bin\conda.bat
no change     D:\Anaconda\condabin\_conda_activate.bat
no change     D:\Anaconda\condabin\rename_tmp.bat
no change     D:\Anaconda\condabin\conda_auto_activate.bat
no change     D:\Anaconda\condabin\conda_hook.bat
no change     D:\Anaconda\Scripts\activate.bat
no change     D:\Anaconda\condabin\activate.bat
no change     D:\Anaconda\condabin\deactivate.bat
no change     D:\Anaconda\Scripts\activate
no change     D:\Anaconda\Scripts\deactivate
no change     D:\Anaconda\etc\profile.d\conda.sh
no change     D:\Anaconda\etc\fish\conf.d\conda.fish
no change     D:\Anaconda\shell\condabin\Conda.psm1
no change     D:\Anaconda\shell\condabin\conda-hook.ps1
no change     D:\Anaconda\Lib\site-packages\xontrib\conda.xsh
no change     D:\Anaconda\etc\profile.d\conda.csh
modified      C:\Users\huyin\.bash_profile

==> For changes to take effect, close and re-open your current shell. <==

I've already added all the necessary folders in Path. enter image description here

Could someone tell me what results in these issues and how can I fix them?

1

There are 1 best solutions below

9
Philippe On

I run these commands to setup conda environment in cygwin :

dir=/cygdrive/d/Anaconda
file=$dir/etc/profile.d/conda.sh
. $file
export PYTHONIOENCODING=UTF-8
conda activate
PATH+=$dir/Scripts

then type this to verify :

python -VV