Installing pylinac is easy no matter your skill! Determine where you’re at and then read the relevant section:
I know Python already¶
Great! To get started install via pip:
$ pip install pylinac
Installing from source (
setup.py install) is possible but not recommended as downloading the source includes numerous sizable test files.
pip should work, the dependencies can sometimes give problems. A workaround is to install the dependencies via
conda, then install pylinac via pip since pylinac itself is pure python.
Pylinac, as a scientific package, has fairly standard scientific dependencies (>= means at least that version or newer):
- numpy >= 1.12
- scipy >= 0.19
- matplotlib >= 2.0
- pydicom >= 1.0
- Pillow >= 4.0
- scikit-image >= 0.12
- scikit-learn >= 0.18
- tqdm == 3.8
- pyyaml >= 3.10
- reportlab >= 3.3
See the numpy/scipy installation instructions if you don’t yet have them.
I’m new to Python¶
That’s okay! If you’re not a programmer at all you’ll have a few things to do to get up and running,
but never fear. Using pylinac requires not just the base language Python, but a few dependencies as well.
Since most physicists don’t program, or if they do it’s in MATLAB, this section will help jumpstart your use of not
pylinac but Python in general and all its wonderful goodness! Getting started with Python takes some work to
get set up and running, but it’s well worth the effort.
Get a Distribution Stack¶
Scientific computing with Python requires some specialized packages which require some specialized computing libraries. While it’s possible you have those libraries (for some odd reason), it’s not likely. Thus, it’s often best to install the libraries pre-compiled. There are several options out there; I’ll list just a few. Be sure to download the 3.x version, preferably the newest:
Anaconda - Continuum Analytics provides this one-stop-shop for tons of scientific libraries in an easy to install format. Just download and run the installer. If you don’t want to install all 200+ packages, a slimmer option exists: Miniconda, which only installs
condaand python installation tools. You can then use conda to install packages individually. Here’s the Anaconda quick start guide.
Unlike the other options, individual packages can be upgraded on demand using the
WinPython - (Windows only) This grassroots project functions similarly to Anaconda, where all packages are precompiled and run out of the box. There are no corporate sponsors for this project, so support is not guaranteed.
See Scipy’s Installation Options for more options.
Python(x,y) is not yet available for Python 3, so don’t choose this to try running pylinac.
If this is the first/only Python distribution you’ll be using it’d be a good idea to activate it when the installer prompts you.
You can install multiple Python stacks/versions, but only one is “active” at any given time.
Get an IDE (optional)¶
If you come from MATLAB, it’s helpful to realize that MATLAB is both a language and an Integrated Development Environment (IDE). Most languages don’t have an official IDE, and some people may tell you IDEs are a crutch. If being a cyborg with superpowers is a crutch, then call me a cripple because I find them extremely useful. As with all power, it must be wielded carefully though. The option of getting an IDE is completely up to you. If you want one, here are some options:
Spyder is part of the Anaconda distribution.