Installation¶
Nani is written in the Python language and hence requires a Python interpreter.
Any of the following Python versions is supported: 2.7, 3.3, 3.4, 3.5, and 3.6.
On top of that, Nani also depends on the numpy
package.
Note
Package dependencies are automatically being taken care off when using
pip
.
Installing pip¶
The recommended [1] approach for installing a Python package such as Nani is
to use pip
, a package manager for projects written in Python. If pip
is
not already installed on your system, you can do so by following these steps:
- Download get-pip.py.
- Run
python get-pip.py
in a shell.
Note
The installation commands described in this page might require sudo
privileges to run successfully.
System-Wide Installation¶
Installing globally the most recent version of Nani and its dependencies can be
done with pip
:
$ pip install nani
Or using easy_install
(provided with setuptools
):
$ easy_install nani
Virtualenv¶
If you’d rather make Nani and its dependencies only available for your specific
project, an alternative approach is to use virtualenv
. First, make sure that
it is installed:
$ pip install virtualenv
Then, an isolated environment needs to be created for your project before installing Nani in there:
$ mkdir myproject
$ cd myproject
$ virtualenv env
New python executable in /path/to/myproject/env/bin/python
Installing setuptools, pip, wheel...done.
$ source env/bin/activate
$ pip install nani
At this point, Nani is available for the project myproject
as long as the
virtual environment is activated.
To exit the virtual environment, run:
$ deactivate
Note
Instead of having to activate the virtual environment, it is also possible
to directly use the env/bin/python
, env/bin/pip
, and the other
executables found in the folder env/bin
.
Note
For Windows, some code samples might not work out of the box. Mainly,
activating virtualenv
is done by running the command
env\Scripts\activate
instead.
Development Version¶
To stay cutting edge with the latest development progresses, it is possible to directly retrieve the source from the repository with the help of Git:
$ git clone https://github.com/christophercrouzet/nani.git
$ cd nani
$ pip install --editable .[dev]
Note
The [dev]
part installs additional dependencies required to assist
development on Nani.
[1] | See the Python Packaging User Guide |