Installation¶
Instructions¶
The recommended way¶
Warning
OCD doesn’t have yes a released version, so the recommanded way will not work and no ocd can be found on the mpe pypi server
The recommended way to install ocd is using pip:
pip install --extra-index-url https://gate.mpe.mpg.de/pypi/simple/ ocd
It’s possible to set the extra index URL permanently by adding the following lines
to the $HOME/.pip/pip.conf file:
[global]
extra-index-url = https://gate.mpe.mpg.de/pypi/simple
or exporting the environment variable:
export PIP_EXTRA_INDEX_URL=https://gate.mpe.mpg.de/pypi/simple
The list of released versions can be seen on the MPE pypi server. A specific version can be
installed using specifiers,
e.g. issuing pip install ocd==0.1.
pip will take care of installing ocd dependances.
We suggest you install ocd into a virtualenv, in an anaconda/conda or in similar environments.
Of course it is also possible to install ocd without any of the above with:
pip install --user --extra-index-url https://gate.mpe.mpg.de/pypi/simple/ ocd
This way the executables shipped with ocd are installed in
$HOME/.local/bin, so make sure to add this to the environment variable
PATH to be able to easily use them on the command line.
The use of sudo when installing with pip is discouraged
and potentially harmful.
To be able to use the ocd docker_mysql command, the docker package
needs to be installed. The easiest way to do it is to specify it during
installation:
pip install <options> ocd[docker]
From local ocd copy¶
If you develop ocd or want to use always the latest version, you can
install it directly from the checked out svn repository.
First you can obtain the source ocd code with
svn checkout svn://luna.mpe.mpg.de/ocd/trunk ocd
If you already have the repository, you can of course keep it up to date with
svn update
Then you can install the library with:
pip install /path/to/ocd
or
cd /path/to/ocd
pip install .
where /path/to/ocd is the base directory containing the setup.py
file.
From online svn repository¶
It is also possible to install ocd directly from the svn repository
with
pip install svn+svn://luna.mpe.mpg.de/ocd/trunk#egg=ocd
If you want to install a specific commit or from a different branch or tag, you can do it issuing one of the following commands
pip install svn+svn://luna.mpe.mpg.de/ocd/trunk@5#egg=ocd
pip install svn+svn://luna.mpe.mpg.de/ocd/tag/v0.0.0#egg=ocd
Other ways¶
Once you obtained the source code as in From local ocd copy, you can install the code also using the good old
cd /path/to/ocd
python setup.py build
python setup.py install
Dependances¶
Mandatory dependences¶
numpy
six
pyhetdex >= 0.12
tcs_lib >= 0.2
peewee
astropy
transitions
pymysql
py >= 1.5
Optional dependences¶
docker interface:
dockertesting:
pytest >= 3.3 pytest-cov pytest-xdist tox
documentation:
sphinx numpydoc
automatic documentation build:
sphinx-autobuild
Development¶
If you develop ocd we suggest to checkout the svn
repository and to install it in “editable” mode
and to install all the optional dependences:
cd /path/to/ocd
pip install -e .[livedoc]
You can also use [not recommended]
python setup.py develop
See Contribute to ocd for more information.