painebenjamin / app.enfugue.ai

ENFUGUE is an open-source web app for making studio-grade images and video using generative AI.
GNU General Public License v3.0
686 stars 65 forks source link

Miniconda is unable to activate enfuge on installation #120

Open MrSuttonmann opened 11 months ago

MrSuttonmann commented 11 months ago

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.

MrSuttonmann commented 11 months ago

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 commented 11 months ago

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:

#!/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.