You are not logged in.

#1 2022-12-26 10:46:54

hully
Member
Registered: 2022-11-14
Posts: 150

miniconda altered /usr/bin/env python

I have installed miniconda3 from the AUR

But now `/usr/bin/env python` opens `/opt/miniconda3/bin/python`.

This breaks a lot of my scripts since that python installation lacks the packages I need.

How can I make it point to `/usr/bin/python` again?

Last edited by hully (2022-12-27 16:53:14)

Offline

#2 2022-12-26 14:48:59

mpan
Member
Registered: 2012-08-01
Posts: 1,207
Website

Re: miniconda altered /usr/bin/env python

If you only built a package based on this PKGBUILD and installed it, this situation is not expected to happen. Something is missing in the description.

Didn’t you also modify your shell’s rc files by sourcing “/opt/miniconda3/etc/profile.d/conda.sh”? Or otherwise making them point to conda version?

If not, didn’t you run their installation script⁽¹⁾ directly instead of doing this through makepkg+pacman?
____
⁽¹⁾ One listed in the sources array.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2022-12-26 17:04:20

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,785

Re: miniconda altered /usr/bin/env python

What are the output of which -a python and of echo $PATH   ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2022-12-29 21:01:54

hully
Member
Registered: 2022-11-14
Posts: 150

Re: miniconda altered /usr/bin/env python

Didn’t you also modify your shell’s rc files by sourcing “/opt/miniconda3/etc/profile.d/conda.sh”?

Yes I did.

It asked me to run some command which put this in my "~/.config/fish/config.fish":

# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba init' !!
set -gx MAMBA_EXE "/usr/bin/micromamba"
set -gx MAMBA_ROOT_PREFIX "/home/raffaele/micromamba"
$MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source
# <<< mamba initialize <<<

What are the output of which -a python and of echo $PATH   ?

Here it is:

❯ which -a python
/opt/miniconda3/bin/python
/usr/bin/python

Offline

#5 2023-01-19 15:23:05

hully
Member
Registered: 2022-11-14
Posts: 150

Re: miniconda altered /usr/bin/env python

So how can I use my system's python while at the same time keeping these lines:

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

at the end of my .bashrc?

They are needed otherwise conda complains when I activate environments

Offline

#6 2023-01-19 17:48:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: miniconda altered /usr/bin/env python

hully wrote:

This breaks a lot of my scripts

If they are your scripts and you want them to use /bin/python rather than whichever python is indicated by /bin/env, then just fix the shebang.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2023-01-20 22:33:37

hully
Member
Registered: 2022-11-14
Posts: 150

Re: miniconda altered /usr/bin/env python

I would like to remove those lines from my .bashrc because (1) it slows down opening of interactive shells significantly (2/3 sec) and (2) I would like to install python libraries with pacman, so that I can replicate the package list on other systems.

But at the same time I prefer not to lose the possibility to manage conda environments, as it seems that they are used by every deep learning frameworks / libraries

Offline

#8 2023-01-20 22:44:52

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,858
Website

Re: miniconda altered /usr/bin/env python

So remove the miniconda init junk from your shell init scripts and manually activate the conda environments when you need it.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#9 2023-01-21 09:15:44

hully
Member
Registered: 2022-11-14
Posts: 150

Re: miniconda altered /usr/bin/env python

WorMzy wrote:

So remove the miniconda init junk from your shell init scripts and manually activate the conda environments when you need it.

I think I will do that. Thanks!

Offline

Board footer

Powered by FluxBB