Skip to content

Instantly share code, notes, and snippets.

@witt3rd
Last active June 18, 2018 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save witt3rd/614c2ea2b8037dc3774f32439416279c to your computer and use it in GitHub Desktop.
Save witt3rd/614c2ea2b8037dc3774f32439416279c to your computer and use it in GitHub Desktop.

Python

Miniconda

Simple way to manage version, environments, and packages. https://conda.io/miniconda.html

Installation

Download and run the bash installer for your platform, listed below.

macOS

curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh

At the end of setup, answer "yes" when it asks if you want to add miniconda to your PATH:

Do you wish the installer to prepend the Miniconda3 install location
to PATH in your /home/<user>/.bash_profile ? [yes|no]
[no] >>> yes

Appending source /home/<user>/miniconda3/bin/activate to /home/<user>/.bash_profile
A backup will be made to: /home/<user>/.bash_profile-miniconda3.bak

For this change to become active, you have to open a new terminal.

To re-source your environment variables:

. ~/.bash_profile
Framework version

Some libraries, like matplotlib, require the 'framework' version of python.

conda install python.app

Then, run python using pythonw.

Linux

curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

At the end of setup, answer "yes" when it asks if you want to add miniconda to your PATH:

Do you wish the installer to prepend the Miniconda3 install location
to PATH in your /home/<user>/.bashrc ? [yes|no]
[no] >>> yes

Appending source /home/<user>/miniconda3/bin/activate to /home/<user>/.bashrc
A backup will be made to: /home/<user>/.bashrc-miniconda3.bak

For this change to become active, you have to open a new terminal.

To re-source your environment variables:

. ~/.bashrc

Update

conda update conda

New project/environment

conda create -n myenv python

Activate/deactivate environment

source activate myenv
source deactivate

Install packages

conda install matplotlib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment