Install Anaconda Link: https://www.continuum.io/downloads
-
Check/List installed packages:
Conda list
-
Upgrade Conda packages:
conda upgrade conda conda upgrade --all
-
Install conda package:
conda install package_name
-
Installing multiple packages:
conda install numpy scipy pandas
-
To specify which version of a package you want by adding the version number:
conda install numpy=1.10
-
To uninstall package:
conda remove package_name
-
To update a package:
conda update package_name
-
To update all packages:
conda update --all
-
If you are not familiar with the exact name you are searching for, try searching with:
conda search search_term
-
Create an environment:
conda create -n env_name list of packages
-n env_name --> sets name of your environment
list of packages --> list of packages you want installed in the environment.
`example: conda create -n my_env numpyconda create -n py3 python=3
conda create -n py python=3.3 `
-
Entering an environment:
source activate my_env
-
Leaving an environment:
source deactivate my_env
-
Save packages of the environment to YAML file:
conda env export > environment.yaml
conda env export --> writes out all the packages in the environment including python version. -
To check all the versions of the packages:
conda env export
-
To create an environment from an environment file:
conda env create -f environment.yaml
-
To list all the environments:
conda env list
-
Removing environments:
conda env remove -n env_name
-
Sharing Environments: When sharing your code on GitHub, it's good practice to make an environment file and include it in the repository. This will make it easier for people to install all the dependencies for your code. Include a
pip requirements.txt
file usingpip freeze
(learn more here) for people not using conda.pip freeze > requirements.txt
How do we include the requirements.txt in a repository?