A comprehensive guide on how to download, install, and use Miniconda. This guide includes steps for creating and activating Conda environments, installing packages within specific environments, and running Python scripts within a chosen environment.
- Download Miniconda using the following link: Miniconda3-py310_22.11.1-1-Linux-x86_64.sh
- Navigate to your downloads directory:
cd path_to_your_downloads_directory
- Make the downloaded file executable:
chmod +x Miniconda3-py310_22.11.1-1-Linux-x86_64.sh
- Run the installer:
./Miniconda3-py310_22.11.1-1-Linux-x86_64.sh
- Follow the on-screen instructions. Accept the licenses and type "yes" when prompted. Install it to the default location.
-
Close and reopen your terminal. You should now see a
(base)
indicator at the beginning of the command prompt, signaling that Miniconda was installed successfully. -
The official Conda Cheat Sheet is a helpful resource.
To create a new environment with a specific Python version, use:
conda create --name your_environment_name python=desired_python_version
Example:
conda create --name my_test_name python=3.8
Note: Some projects may require a specific Python version.
- List all available environments:
conda env list
- Activate the desired environment:
conda activate your_environment_name
Once activated, you'll notice the (base)
indicator changes to (your_environment_name)
.
To ensure a clean Python installation, use Conda environments instead of modifying the base Python installation.
- Navigate to your project workspace.
- Activate the desired Conda environment.
- Install the required packages:
pip install -r requirements.txt
- Open a terminal in the directory containing your
main.py
file. - Activate the desired Conda environment.
- Run your script:
python main.py