|
| 1 | +# Installation instructions |
| 2 | + |
| 3 | +**We only support the Anaconda distribution, although other Python distributions should work too.** |
| 4 | + |
| 5 | +In this a *work-in-progress* document, we give very detailled instructions about how to install a full scientific Python distribution. This document targets beginners, and tackles things such as using the command-line interface, installing Anaconda, etc. These instructions are sometimes hard to find, scattered across many websites, blog posts, and posts on support mailing lists. Eventually, you'll find here the very minimum you need to know. |
| 6 | + |
| 7 | +This document aims at being maintained by the community: please propose a Pull Request if an information is missing. |
| 8 | + |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +Anaconda is a program created by Continuum Analytics. It lets you install a Python distribution with many scientific packages like NumPy, SciPy, IPython, matplotlib, and many others. Anaconda also comes with a packaging tool named conda. This tool lets you maintain, install, and update your Python packages. It is actually more general than that, in that it can deal with any non-Python binary package. |
| 13 | + |
| 14 | + |
| 15 | +## Things to know |
| 16 | + |
| 17 | +You need to know/learn, several things before you start: |
| 18 | + |
| 19 | +* The system terminal, or command-line interface. |
| 20 | +* Git, a version control system. |
| 21 | + |
| 22 | + |
| 23 | +### The terminal |
| 24 | + |
| 25 | +#### Windows |
| 26 | + |
| 27 | +Use Powershell. |
| 28 | + |
| 29 | + |
| 30 | +#### Linux |
| 31 | + |
| 32 | +TODO |
| 33 | + |
| 34 | +#### Mac OS X |
| 35 | + |
| 36 | +TODO |
| 37 | + |
| 38 | + |
| 39 | +### Git |
| 40 | + |
| 41 | +Not strictly required, but highly recommended if you want to use obscure packages, or if you start to write significant amount of code. |
| 42 | + |
| 43 | +TODO: |
| 44 | + |
| 45 | +* Installing git... |
| 46 | +* git bash... |
| 47 | +* git GUI... |
| 48 | + |
| 49 | + |
| 50 | +### Environment variables and system paths |
| 51 | + |
| 52 | +TODO |
| 53 | + |
| 54 | + |
| 55 | +## Installing Anaconda |
| 56 | + |
| 57 | +Once you're relatively confortable with the terminal and git, you can install Anaconda, a Python distribution. |
| 58 | + |
| 59 | + |
| 60 | +### Windows |
| 61 | + |
| 62 | +* Install Anaconda for Windows with Python 3.x (the latest is 3.4 in Sept. 2014). |
| 63 | +* Don't install Anaconda with admin rights: check "Just for me" in the installer. |
| 64 | +* Install in a path like `c:\anaconda`. |
| 65 | +* You'll be able to install Python 2.x in a separate conda environment. |
| 66 | +* **If you use Powershell**, you need to [use customized activate/deactivate scripts](https://github.com/Liquidmantis/PSCondaEnvs.git). Clone the repository, and copy them in `c:\anaconda\scripts` or similar. |
| 67 | + |
| 68 | + |
| 69 | +### Linux |
| 70 | + |
| 71 | +TODO |
| 72 | + |
| 73 | + |
| 74 | +### Mac OS X |
| 75 | + |
| 76 | +TODO |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | +## Using Anaconda |
| 81 | + |
| 82 | +### The basics |
| 83 | + |
| 84 | + |
| 85 | +## Environments |
| 86 | + |
| 87 | +Anaconda lets you maintain various isolated environements. You can switch to any environment at any time from the command-line. |
| 88 | + |
| 89 | +### Get the list of installed environments |
| 90 | + |
| 91 | +`conda info -e` |
| 92 | + |
| 93 | + |
| 94 | +### Switch to another environment |
| 95 | + |
| 96 | +* On Windows: `activate myenv` |
| 97 | +* On another OS: `source activate myenv` |
| 98 | + |
| 99 | + |
| 100 | +### Installing Python 2.x side-by-side with the default Python 3 |
| 101 | + |
| 102 | +* Run the following command: |
| 103 | + |
| 104 | + `conda create -n py27 python=2.7.8` |
| 105 | + `(press `f` if you have a WARNING) |
| 106 | + |
| 107 | +* You'll have no package in this new environment. Make sure to install **pip**! |
| 108 | + |
| 109 | + `conda install pip` |
| 110 | + `conda update pip` |
| 111 | + |
| 112 | + |
| 113 | +## Running Python, IPython, and the IPython notebook |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +## Using a code editor |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | +## Installing new packages |
| 122 | + |
| 123 | +* `conda install mypackage` |
| 124 | +* If that doesn't work, it needs that there is no conda package for this Python module. There are solutions. |
| 125 | +* **Important**: make sure pip is installed in the currently activated environment with `conda install pip`. |
| 126 | +* Then you can try to use pip: `pip install mypackage`. |
| 127 | + |
| 128 | + |
0 commit comments