Installation#

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

Note

Installing from source (setup.py install) is possible but not recommended as downloading the source includes numerous sizable test files.

Dependencies#

Pylinac, as a scientific package, has fairly standard scientific dependencies (>= means at least that version or newer). Installing the package via pip will install these for you:

argue
matplotlib >= 2.0
numpy >= 1.16
Pillow >= 4.0
py-linq
pydantic >= 2.0
pydicom >= 2.0
reportlab >= 3.3
scikit-image >= 0.17
scipy >= 1.1
tabulate~=0.9.0
tqdm >= 3.8

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 just 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 conda and python installation tools. You can then use conda to install packages individually. Here’s the Anaconda quick start guide.

    Note

    Unlike the other options, individual packages can be upgraded on demand using the conda tool.

  • 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.

Warning

Python(x,y) is not yet available for Python 3, so don’t choose this to try running pylinac.

Note

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.

Note

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:

  • PyCharm - A fully-featured, rich IDE. It’s arguably king of the heavyweights and free. At least try it. Here’s the PyCharm quick start guide.

    https://www.jetbrains.com/lp/pycharm-pro/static/5-refactoring-34f412bbb8d494a1fa4c8239eb7f0d5b.png
  • Spyder - A MATLAB-like IDE with similar layout, preferred by many working in the scientific realm. Here are the Spyder docs.

    Note

    Spyder is part of the Anaconda distribution.

    http://1.bp.blogspot.com/-KfAKKK_YN38/TkaV08KWgLI/AAAAAAAAB-s/TEDUviTJBeU/s1600/spyder_ipython012b.png