Anaconda (aide-mémoire)
Anaconda (aide-mémoire)

Anaconda (aide-mémoire)

♻ Update Conda

# MAJ de la distribution conda
conda update conda
# MAJ de tous les paquets
conda update --all

🌟Install jupyterlab

conda create -n Sciences
conda activate Sciences
conda install -n Sciences -c conda-forge jupyterlab jupyter_nbextensions_configurator line_profiler memory_profiler

Install the debugger

conda install -n Sciences -c conda-forge xeus-python=0.8.6 notebook=6 jupyterlab=2 ptvsd nodejs
jupyter labextension install @jupyterlab/debugger
conda update --all

Install the Code Formatter

conda install nodejs
jupyter labextension install @ryantam626/jupyterlab_code_formatter
conda install -c conda-forge jupyterlab_code_formatter
jupyter serverextension enable --py jupyterlab_code_formatter
conda install black isort

Create the directory

C:\Users\remi\AppData\Local\black\black\Cache\19.10b0

Install tools

conda install -n Sciences -c conda-forge numpy pandas matplotlib scipy pyserial scikit-learn sympy seaborn cython geopandas basemap

🧹Conda clean

conda clean --all

⛔ Uninstall a kernel or install it

jupyter kernelspec list
jupyter kernelspec uninstall unwanted-kernel
python -m ipykernel install --user --name=Sciences

🧮 Installation de Jupyter et de ses extensions

conda install -n Sciences -c conda-forge notebook line_profiler memory_profiler jupyter_contrib_nbextensions jupyter_nbextensions_configurator

---
#don't do this
#jupyter contrib nbextension install --user
jupyter nbextensions_configurator enable --user

conda install -c conda-forge ipywidgets
jupyter nbextension disable --py widgetsnbextension
jupyter nbextension enable --py widgetsnbextension

#until fix with 6 version
conda install "nbconvert=5.6.1"

📦 Install packages

conda install numpy pandas matplotlib scipy pyserial scikit-learn sympy seaborn cython

👵 Force 32bit env

set CONDA_FORCE_32BIT=1

👨🏻‍💼 Managing Conda and Anaconda

Verify conda is installed, check version

conda info

Update conda package and environment manager

conda update conda

Update the anaconda meta package

conda update anaconda

🏝Managing Environments

Get a list of all my environments, Active environment shown with *

conda info --envs

conda info -e

Create an environment and install program(s)

conda create --name snowflakes biopython

conda create -n snowflakes biopython

Activate the new environment to use it

conda activate snowflakes

Deactivate the environment

conda deactivate

Create a new environment, specify Python version

conda create -n bunnies python=3.4 astroid

Make exact copy of an environment

conda create -n flowers --clone snowflakes

Delete an environment

conda remove -n flowers --all

Save current environment to a file

conda env export > puppies.yml

Load environment from a file

conda env create -f puppies.yml

Managing Python

Check versions of Python available to install

conda search --full-name python

conda search -f python

Install different version of Python in new environment

conda create -n snakes python=3.4

📝Managing .condarc Configuration

Get all keys and values from my .condarc file

conda config --get

Get value of the key channels from .condarc file

conda config --get channels

Add a new value to channels so conda looks for packages in this location

conda config --add channels pandas

📦 Managing Packages, Including Python

View list of packages and versions installed in active environment

conda list

Search for a package to see if it is available to conda install

conda search beautiful-soup

Install a new package

NOTE: If you do not include the name of the environment, it will install in the current active environment.

conda install -n bunnies beautiful-soup

Update a package in the current environment

conda update beautiful-soup

Search for a package in a specific location (the pandas channel on Anaconda.org)

conda search --override-channels -c pandas bottleneck

Install a package from a specific channel

conda install -c pandas bottleneck

Install in a specific env

conda install -n NAME_ENV <package>

Search for a package to see if it is available from the Anaconda repository

conda search --override-channels -c defaults beautiful-soup

Install commercial Continuum packages

conda install iopro accelerate

Build a Conda package from a Python Package Index (PyPi) Package

conda skeleton pypi pyinstrument

conda build pyinstrument

🗑Removing Packages or Environments

Remove one package from any named environment

conda remove --name bunnies beautiful-soup

Remove one package from the active environment

conda remove beautiful-soup

Remove multiple packages from any environment

conda remove --name bunnies beautiful-soup astroid

Remove an environment

conda remove --name snakes --all