-
-
Notifications
You must be signed in to change notification settings - Fork 15
How to install `conda` to isolate the python package from your computer
Here's a simple step-by-step guide to install (mini)conda and use it to run ComfyUI :
- Go to the Miniconda download page: Miniconda Downloads.
-
Choose your operating system: Select the correct installer for your system (Windows, macOS, or Linux).
-
For Windows: Download the
.exe
file. -
For macOS: Download the
.pkg
file. -
For Linux: Download the appropriate
.sh
file.
-
For Windows: Download the
-
Run the installer:
-
Windows: Double-click the
.exe
file and follow the prompts. Make sure to check the box that says "Add Miniconda to my PATH environment variable". -
macOS/Linux: Open the terminal, navigate to the location of the
.sh
file, and run:Follow the prompts to complete the installation.bash Miniconda3-latest-Linux-x86_64.sh # Adjust for the file name
-
Windows: Double-click the
Once Miniconda is installed:
- Windows: Open the Anaconda Prompt from the Start Menu.
- macOS/Linux: Open your terminal.
In the terminal, type the following to create a new Python environment (an isolated space for different versions of Python and libraries):
conda create --name ComfyUI python=3.11
Here, ComfyUI
is the name of your environment, and python=3.11
installs Python version 3.11.
After creating the environment, you need to activate it:
conda activate ComfyUI
If your conda env is activated you should see the name ComfyUI
at the beginning of the CLI line like this :
# before
MaraScott_Cli>
# after
(ComfyUI) MaraScott_Cli>
You can now run ComfyUI which will automatically install all necessary Python libraries (e.g., numpy
, requests
).
If you use the portable version, you are use to execute run_nvidia_gpu.bat
which contains the following code
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
pause
I suggest to create a new file called run_nvidia_gpu_with_conda.bat
with the following code
# conda activate ComfyUI
python -s ComfyUI\main.py --windows-standalone-build
pause
Only create this file for reminder but do not try to execute it by double-clicking it cause the conda env
won't be activated, instead from your terminal with conda env
activated execute this code :
(ComfyUI) MaraScott_Cli> python -s ComfyUI\main.py --windows-standalone-build
When you're done, deactivate the environment by typing:
conda deactivate
That's it! You've successfully installed (mini)conda, created a Python environment, and run ComfyUI within its own conda env.