Download Anaconda for a hassle-free way of configuring your development environment.
Download the Python 3 version b/c Python 2 is no longer maintained
If you're wondering "Why not use
virutalenv
and/orpip
?", Anaconda (aka conda) is built specifically for working with the data science ecosystem of languages (Python, R, Julia) and libraries (scipy, numpy, pandas, scikit-learn, plotly/matplotlib), many of which require non-Python build requirements like C/C++ and Fortran compilers.
Use conda to setup a Python 3 environment:
# only need to create the environment once
conda env create -f my-conda-env.yml
# then activate the environment each time you open a new shell
conda activate my-conda-env
Conda makes it easy to manage the data science libraries, which are often difficult to install. Conda can be used as your package manager (instead of pip) and it can install multiple isolated Python versions like virtualenv.
Conda can install dependencies from your existing requirements.txt
too with this snippet
while read requirement; do conda install --yes $requirement; done < requirements.txt
# you may also want to add conda-forge as another channel to download from
conda config --append channels conda-forge
But sometimes you may still need to install with pip
After installing or updating dependencies, update the environment file with
conda env export | grep -v "^prefix: " > my-conda-env.yml
Other useful conda commands from the docs
List all environments
remove an environment
create a new python3 env
update to the latest version of a dependency
update and environment using a file