conda-forge / miniforge

A conda-forge distribution.
https://conda-forge.org/miniforge
Other
6.14k stars 318 forks source link

Unable to use env binaries from subshell in conda environment #365

Open babinskiy opened 1 year ago

babinskiy commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

Hi all, I installed Miniforge on Windows host, installed some software in base environment (such a git, make etc) but I have issue with calling those biranies from subshell started in conda env.

conda activate base
git status   # works ok, but
bash -c 'git status'  # issued "bash: line 1: git: command not found" error

The same situation happens in any shell script or Makefile which I run in conda env.

From my perspective, it happens because git binary is placed in C:\Users\Mykola_Babinskyi.miniforge3\Library\bin\ but in runtime this folder is masked by another:

> mount 
C:/Users/MYKOLA~1/AppData/Local/Temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/Users/Mykola_Babinskyi/.miniforge3/Library on / type ntfs (binary,noacl,auto)                  
C:/Users/Mykola_Babinskyi/.miniforge3/Library/usr/bin on /bin type ntfs (binary,noacl,auto)  # this mount masks .../Library/bin folder
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)

Does anyone know how to handle this situation?

Installed packages

conda list
# packages in environment at C:\Users\Mykola_Babinskyi\.miniforge3:
#
# Name                    Version                   Build  Channel
brotlipy                  0.7.0           py39hb82d6ee_1004    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2022.9.24            h5b45459_0    conda-forge
certifi                   2022.9.24          pyhd8ed1ab_0    conda-forge
cffi                      1.15.0           py39h0878f49_0    conda-forge
charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
conda                     22.9.0           py39hcbf5309_1    conda-forge
conda-package-handling    1.8.1            py39hb3671d1_1    conda-forge
cryptography              37.0.2           py39h7bc7c5c_0    conda-forge
git                       2.38.0               h57928b3_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libzlib                   1.2.12               h8ffe710_0    conda-forge
menuinst                  1.4.18           py39hcbf5309_1    conda-forge
miniforge_console_shortcut 1.0                  h57928b3_0    conda-forge
openssl                   1.1.1q               h8ffe710_0    conda-forge
pip                       22.1.2             pyhd8ed1ab_0    conda-forge
pycosat                   0.6.3           py39hb82d6ee_1010    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py39hcbf5309_5    conda-forge
python                    3.9.13          h9a09f29_0_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pywin32                   303              py39hb82d6ee_0    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
ruamel_yaml               0.15.80         py39hb82d6ee_1007    conda-forge
setuptools                62.3.2           py39hcbf5309_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.38.5               h8ffe710_0    conda-forge
tk                        8.6.12               h8ffe710_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tqdm                      4.64.0             pyhd8ed1ab_0    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
urllib3                   1.26.9             pyhd8ed1ab_0    conda-forge
vc                        14.2                 hb210afc_6    conda-forge
vs2015_runtime            14.29.30037          h902a5da_6    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
win_inet_pton             1.1.0            py39hcbf5309_4    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge

Environment info

conda info

     active environment : base
    active env location : C:\Users\Mykola_Babinskyi\.miniforge3
            shell level : 1
       user config file : C:\Users\Mykola_Babinskyi\.condarc
 populated config files : C:\Users\Mykola_Babinskyi\.miniforge3\.condarc
          conda version : 22.9.0
    conda-build version : not installed
         python version : 3.9.13.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : C:\Users\Mykola_Babinskyi\.miniforge3  (writable)
      conda av data dir : C:\Users\Mykola_Babinskyi\.miniforge3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : C:\Users\Mykola_Babinskyi\AppData\Local\conda\pkgs
       envs directories : C:\Users\Mykola_Babinskyi\.miniforge3\envs
                          C:\Users\Mykola_Babinskyi\.conda\envs
                          C:\Users\Mykola_Babinskyi\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/22.9.0 requests/2.27.1 CPython/3.9.13 Windows/10 Windows/10.0.19044
          administrator : False
             netrc file : None
           offline mode : False
babinskiy commented 1 year ago

Also, I have another git binary in C:/.../Library/mingw64/bin but there only /mingw-w64/bin is in $PATH, so shell cant find it..