Member-only story
Anaconda in Python
Anaconda is a popular open-source distribution of Python (and R) specifically aimed at scientific computing, data science, and machine learning. It simplifies package management and deployment by bundling together numerous data science packages and their dependencies so that users don’t have to manage installations individually.
Anaconda comes with Conda, a package and environment manager, which helps handle different project environments and package versions without conflicts. This is particularly useful when you’re working on multiple projects that require different versions of the same packages.
Example 1: Creating and Managing Environments with Anaconda
Here’s how you can use Anaconda to create a new isolated environment for a project:
- Creating a New Environment:
Open your terminal and create a new environment named myenv
that specifically uses Python 3.8:
conda create --name myenv python=3.8
This command creates an environment called myenv
with Python 3.8 installed in it.
2. Activating the Environment:
To use or install packages in myenv
, you need to activate it:
conda activate myenv