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

Miniconda is unable to activate enfuge on installation #120

Open
MrSuttonmann opened this issue Dec 7, 2023 · 2 comments
Open

Miniconda is unable to activate enfuge on installation #120

MrSuttonmann opened this issue Dec 7, 2023 · 2 comments
Assignees

Comments

@MrSuttonmann
Copy link

MrSuttonmann commented Dec 7, 2023

After the install script (Linux) creates the Enfuge environment, it errors with the following message:


 To activate this environment, use

     $ conda activate enfugue

 To deactivate an active environment, use

     $ conda deactivate

./enfugue.sh: line 357: /home/ted/miniconda3/condabin/activate: No such file or directory
Could not find or download enfugue. Exiting.

~/miniconda/condabin only contains one file named conda.

@painebenjamin painebenjamin self-assigned this Dec 7, 2023
@MrSuttonmann
Copy link
Author

Looking through the script, I think this line is wrong:

source $(dirname $CONDA)/activate enfugue

if my understanding is that activate is a parameter to conda, not a separate binary, is correct.

@painebenjamin
Copy link
Owner

painebenjamin commented Dec 7, 2023

Hello @MrSuttonmann, thank you for the report!

You are correct, there was an issue with how the script applied paths. It should be fixed now, please re-run the curl command to download and run the latest script. That should hopefully take care of everything for you.

Looking through the script, I think this line is wrong:

source $(dirname $CONDA)/activate enfugue

if my understanding is that activate is a parameter to conda, not a separate binary, is correct.

This is a bit of an annoying complication with shell scripts and conda. There are two directories:

  • /home/<username>/miniconda3/condabin contains the actual conda binary.
  • /home/<username>/miniconda3/bin contains shell scripts that execute using sh or python. activate is a shell script in this directory containing the following code:
#!/bin/sh
_CONDA_ROOT="/home/benjamin/miniconda3"
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
\. "$_CONDA_ROOT/etc/profile.d/conda.sh" || return $?
conda activate "$@"

The reason to use this is because of how conda launches environments. If you're running bash and do something like this in a shell script:

conda activate enfugue
which python

You will NOT get an updated path to that environment's python. That is because running conda activate launches a new shell with the environment variables changed, it does not change the current one. We can skip launching the new shell and instead directly evaluate the activate script in the same environment by using source, as I did in the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants