Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting 'alias conda="/path/to/miniconda3/bin/conda"' before conda initialized breaks conda #12885

Open
2 tasks done
mulroony opened this issue Jul 13, 2023 · 2 comments
Open
2 tasks done
Labels
severity::4 low; functionality is inconvenient source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type

Comments

@mulroony
Copy link

mulroony commented Jul 13, 2023

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

In bash, haven't tested other shells, if in your .bashrc or .bash_profile before the conda initialize code block you add alias conda="/path/to/miniconda3/bin/conda" it breaks conda. It appears to create a loop that injects '/path/to/miniconda3/bin' over and over into your PATH variable. Tested with a couple different versions of conda on both Mac & Linux and it does the same thing.

For example if in my ~/.bashrc I change it from...

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/pmulrooney/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/pmulrooney/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/home/pmulrooney/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/pmulrooney/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

To...

alias conda="/home/pmulrooney/miniconda3/bin/conda"

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/pmulrooney/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/pmulrooney/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/home/pmulrooney/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/pmulrooney/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

Then launch a new shell. Running echo $PATH will show the repeat injection and conda will be very slow if it works at all.

Conda Info

$ conda info

     active environment : base
    active env location : /home/pmulrooney/miniconda3
            shell level : 1
       user config file : /home/pmulrooney/.condarc
 populated config files : /home/pmulrooney/.condarc
          conda version : 23.3.1
    conda-build version : not installed
         python version : 3.9.7.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.17=0
                          __linux=3.10.0=0
                          __unix=0=0
       base environment : /home/pmulrooney/miniconda3  (writable)
      conda av data dir : /home/pmulrooney/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /tmp/pmulrooney/pkgs
                          /home/pmulrooney/miniconda3/pkgs
       envs directories : /home/pmulrooney/miniconda3/envs
                          /home/pmulrooney/.conda/envs
               platform : linux-64
             user-agent : conda/23.3.1 requests/2.27.1 CPython/3.9.7 Linux/3.10.0-1160.92.1.el7.x86_64 rhel/7.9 glibc/2.17
                UID:GID : 927813:10050003
             netrc file : None
           offline mode : False

Conda Config

$ conda config --show-sources
==> /home/pmulrooney/.condarc <==
allow_conda_downgrades: True
default_threads: 12
pkgs_dirs:
  - /tmp/pmulrooney/pkgs
  - /home/pmulrooney/miniconda3/pkgs
ssl_verify: True
channels:
  - defaults

Conda list

$ conda list --show-channel-urls
# packages in environment at /home/pmulrooney/miniconda3:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
bash-completion           2.11                          0    conda-forge
boltons                   23.0.0           py39h06a4308_0    defaults
brotlipy                  0.7.0           py39h27cfd23_1003    defaults
bzip2                     1.0.8                h7b6447c_0    defaults
c-ares                    1.18.1               h7f8727e_0    defaults
ca-certificates           2022.12.7            ha878542_0    conda-forge
certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
cffi                      1.15.0           py39hd667e15_1    defaults
chardet                   4.0.0           py39h06a4308_1003    defaults
charset-normalizer        2.0.4              pyhd3eb1b0_0    defaults
conda                     23.3.1           py39hf3d152e_0    conda-forge
conda-bash-completion     1.5                           1    conda-forge
conda-package-handling    1.7.3            py39h27cfd23_1    defaults
cryptography              36.0.0           py39h9ce1e76_0    defaults
curl                      7.80.0               h7f8727e_0    defaults
icu                       68.1                 h2531618_0    defaults
idna                      3.3                pyhd3eb1b0_0    defaults
jq                        1.6               h27cfd23_1000    defaults
jsonpatch                 1.32               pyhd3eb1b0_0    defaults
jsonpointer               2.1                pyhd3eb1b0_0    defaults
krb5                      1.19.2               hcc1bbae_0    conda-forge
ld_impl_linux-64          2.35.1               h7274673_9    defaults
libarchive                3.5.2                hccf745f_1    conda-forge
libcurl                   7.80.0               h0b77cf5_0    defaults
libedit                   3.1.20210910         h7f8727e_0    defaults
libev                     4.33                 h7f8727e_1    defaults
libffi                    3.3                  he6710b0_2    defaults
libgcc-ng                 12.2.0              h65d4601_19    conda-forge
libgomp                   12.2.0              h65d4601_19    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
libmamba                  0.19.1               h3985d26_0    conda-forge
libmambapy                0.19.1           py39h8bfa403_0    conda-forge
libnghttp2                1.46.0               hce63b2e_0    defaults
libsolv                   0.7.19               h780b84a_5    conda-forge
libssh2                   1.9.0                h1ba5d50_1    defaults
libstdcxx-ng              11.2.0              he4da1e4_11    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
libzlib                   1.2.13               h166bdaf_4    conda-forge
llvm-openmp               12.0.1               h4bd325d_1    conda-forge
lz4-c                     1.9.3                h295c915_1    defaults
lzo                       2.10                 h7b6447c_2    defaults
mamba                     0.19.1           py39hfa8f2c8_0    conda-forge
mamba-bash-completion     1.0                  ha770c72_0    conda-forge
micromamba                1.4.2                         1    conda-forge
ncdu                      1.16                 h46c0cb4_0    conda-forge
ncurses                   6.3                  h7f8727e_2    defaults
oniguruma                 6.9.7.1              h27cfd23_0    defaults
openssl                   1.1.1t               h0b41bf4_0    conda-forge
packaging                 23.0             py39h06a4308_0    defaults
pip                       21.2.4           py39h06a4308_0    defaults
pluggy                    1.0.0            py39h06a4308_1    defaults
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.3            py39h27cfd23_0    defaults
pycparser                 2.21               pyhd3eb1b0_0    defaults
pyopenssl                 21.0.0             pyhd3eb1b0_1    defaults
pysocks                   1.7.1            py39h06a4308_0    defaults
python                    3.9.7                h12debd9_1    defaults
python_abi                3.9                      2_cp39    conda-forge
readline                  8.1.2                h7f8727e_1    defaults
reproc                    14.2.3               h7f98852_0    conda-forge
reproc-cpp                14.2.3               h9c3ff4c_0    conda-forge
requests                  2.27.1             pyhd3eb1b0_0    defaults
ruamel.yaml               0.17.21          py39h5eee18b_0    defaults
ruamel.yaml.clib          0.2.6            py39h5eee18b_1    defaults
ruamel_yaml               0.15.100         py39h27cfd23_0    defaults
setuptools                58.0.4           py39h06a4308_0    defaults
six                       1.16.0             pyhd3eb1b0_0    defaults
sqlite                    3.37.0               hc218d9a_0    defaults
tk                        8.6.11               h1ccaba5_0    defaults
toolz                     0.12.0           py39h06a4308_0    defaults
tqdm                      4.62.3             pyhd3eb1b0_1    defaults
tzdata                    2021e                hda174b7_0    defaults
urllib3                   1.26.7             pyhd3eb1b0_0    defaults
wheel                     0.37.1             pyhd3eb1b0_0    defaults
xz                        5.2.5                h7b6447c_0    defaults
yaml                      0.2.5                h7b6447c_0    defaults
yaml-cpp                  0.6.3                he1b5a44_4    conda-forge
zlib                      1.2.13               h166bdaf_4    conda-forge
zstd                      1.5.0                ha4553b6_1    defaults

Additional Context

No response

@mulroony mulroony added the type::bug describes erroneous operation, use severity::* to classify the type label Jul 13, 2023
@travishathaway
Copy link
Contributor

Hi @mulroony,

Thanks for reporting this. This is definitely good information to know, but I also think this is a pretty low priority bug given the work around is relatively straightforward and simple.

I'll be happy to leave this bug issue open though if others want to chime in, but I would not expect that the maintainers would get around to working on this anytime soon given our current workload.

@travishathaway travishathaway added source::community catch-all for issues filed by community members severity::4 low; functionality is inconvenient labels Jul 18, 2023
@mulroony
Copy link
Author

@travishathaway Completely understand. Figured I would report and see if it was an easy check / fix for someone that knows the code base better than I do.

@beeankha beeankha changed the title Setting 'alias conda="/path/to/miniconda3/bin/conda"' before conda initialized breaks conda Setting 'alias conda="/path/to/miniconda3/bin/conda"' before conda initialized breaks conda Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity::4 low; functionality is inconvenient source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants