~ / blog / Using conda to manage packages
# Why use conda
The following quote is from Conda’s github page [1]
Conda is a cross-platform, Python-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for other systems as well. Conda makes environments first-class citizens, making it easy to create independent environments even for C libraries. Conda is written entirely in Python, and is BSD licensed open source.
The main advantage of using conda to manage your packages and environment is that it will work across platforms. Conda also uses hard linking, so it is inexpensive to create multiple copies of the same package
# How to
One simple way to start is to first specify a
environment.yml
file
The name of the environment can be changed. Activate the environment by using the following.
Then you can create the environment by
You can update the environment after adding a package to
environment.yml
by using the following
Alternatively, you can create a new empty environment by using either one of the following
In this case, pelican-env
is the name of the
environment. You can follow the name of the environment with all the
packages you want separated by spaces. You must have at least one
package to create a environment.
After the environment is created, you can source the environment :
You can install packages here using one of the following :
When you have set up the environment and would like to share it, you can run the following to generate a .yml file
I like to update by environment.yml
by running the
following