Installation¶
Requirements¶
pyoof has the following strict requirements:
Python 3.5 or later.
setuptools: Used for the package installation.
NumPy 1.11 or later.
SciPy: 0.15 or later.
Astropy: 2.4 or later.
pytest 2.6 or later.
matplotlib 1.5 or later: To provide plotting functionality.
PyYAML 3.11 or later.
For future versions dependencies will be reduced.
Installing pyoof¶
Note
Currently the package installation is not working without a prior installation of the miniconda distribution (or anaconda distribution). In the mean time please install miniconda and follow the instructions below.
Using pip¶
To install pyoof with pip, simply run
pip install pyoof
Note
Use the --no-deps
flag if you already have dependency packages
installed, since otherwise pip will sometimes try to “help” you
by upgrading your installation, which may not always be desired.
Note
If you get a PermissionError
this means that you do not have the
required administrative access to install new packages to your Python
installation. In this case you may consider using the --user
option
to install the package into your home directory. You can read more
about how to do this in the pip documentation.
We recommend to use a Python distribution, such as Anaconda.
Do not install pyoof or other third-party packages using sudo
unless you are fully aware of the risks.
Installation from source¶
There are two options, if you want to build pyoof from sources. Either, you
install the tar-ball (*.tar.gz
file) from PyPI and extract it to the directory of
your choice, or, if you always want to stay up-to-date, clone the git
repository:
git clone https://github.com/tcassanelli/pyoof
Then go into the pyoof
source directory and run:
python setup.py install
Again, consider the --user
option or even better use a python distribution
such as Anaconda to avoid messing up
the system-wide Python installation.
Troubleshooting¶
If you are a macOS user using miniconda3, you may encounter the following statement once you run pyoof
>>> import pyoof # or import matplotlib.pyplot as plt
RuntimeError: Python is not installed as a framework. The Mac OS X
backend ...
This is a known issue that is solved by changing the default matplotlib backend.
Searching for the matplotlibrc
file and modifying it with backend: TkAgg
. To look into the matplotlib dependencies use the following code
>>> import os
>>> import matplotlib
>>> print(os.path.dirname(matplotlib.__file__))
some/path/
Then open and modify some/path/mpl-data/matplotlibrc
.
Testing an installed pyoof¶
The easiest way to test your installed version of pyoof
is running
correctly is to use the test()
function:
import pyoof
pyoof.test()
To run the tests for one sub-package, e.g., aperture
, only:
import pyoof
pyoof.test('aperture')
The tests should run and print out any failures, which you can report at the pyoof issue tracker.
Note
This way of running the tests may not work if you do it in the
pyoof
source distribution directory.
If you prefer testing on the command line and usually work with the source code, you can also do
python setup.py test
# to run tests from a sub-package
python setup.py test -P aperture