Installation¶
Installing with pip¶
These instructions cover installation with the pip
package
management tool. This will install pymodeler and its dependencies into
your python distribution.
Before starting the installation process, you will need to determine whether you have setuptools and pip installed in your local python environment. The following command will install both packages in your local environment:
$ curl https://bootstrap.pypa.io/get-pip.py | python -
Check if pip is correctly installed:
$ which pip
Once again, if this isn’t the pip in your python environment something went wrong. Now install pymodeler by running:
$ pip install pymodeler
Finally, check that pymodeler imports:
$ python
Python 2.7.8 (default, Aug 20 2015, 11:36:15)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymodeler
>>> pymodeler.__file__
The instructions describe how to install development versions of Pymodeler. Before installing a development version we recommend first installing a tagged release following the Installing with pip instructions above.
The development version of Pymodeler can be installed by running pip
install
with the URL of the git repository:
$ pip install git+https://github.com/kadrlica/pymodeler.git
This will install the most recent commit on the master branch. Note that care should be taken when using development versions as features/APIs under active development may change in subsequent versions without notice.
Upgrading¶
By default installing pymodeler with pip
will get the latest tagged
released available on the PyPi
package respository. You can check your currently installed version
of pymodeler with pip show
:
$ pip show pymodeler
To upgrade your pymodeler installation to the latest version run the
installation command with --upgrade --no-deps
(remember to also
include the --user
option if you’re running at SLAC):
$ pip install pymodeler --upgrade --no-deps
Collecting pymodeler
Installing collected packages: pymodeler
Found existing installation: pymodeler 0.1.0
Uninstalling pymodeler-0.1.0:
Successfully uninstalled pymodeler-0.1.0
Successfully installed pymodeler-0.1.1
Developer Installation¶
These instructions describe how to install pymodeler from its git source
code repository using the setup.py
script. Installing from source
can be useful if you want to make your own modifications to the
pymodeler source code. Note that non-developers are recommended to
install a tagged release of pymodeler following the Installing with pip or
instructions above.
First clone the pymodeler git repository and cd to the root directory of the repository:
$ git clone https://github.com/kadrlica/pymodeler.git
$ cd pymodeler
To install the latest commit in the master branch run setup.py
install
from the root directory:
# Install the latest commit
$ git checkout master
$ python setup.py install --user
A useful option if you are doing active code development is to install
your working copy of the package. This will create an installation in
your python distribution that is linked to the copy of the code in
your local repository. This allows you to run with any local
modifications without having to reinstall the package each time you
make a change. To install your working copy of pymodeler run with the
develop
argument:
# Install a link to your source code installation
$ python setup.py develop --user
You can later remove the link to your working copy by running the same
command with the --uninstall
flag:
# Install a link to your source code installation
$ python setup.py develop --user --uninstall
Specific release tags can be installed by running git checkout
before running the installation command:
# Checkout a specific release tag
$ git checkout X.X.X
$ python setup.py install --user
To see the list of available release tags run git tag
.