# Installation¶

SpecViz is distributed through the Anaconda package manager. Specifically, it lives within Space Telescope Science Institute’s AstroConda channel.

If you do not have Anaconda, please follow the instructions here to install it, or scroll down for manual installation of SpecViz.

## Install via Anaconda¶

If you have AstroConda setup, then all you have to do to install SpecViz is simply type the following at any Bash terminal prompt:

$conda install specviz  If you do not have AstroConda setup, then you can install SpecViz by specifying the channel in your install command: $ conda install --channel http://ssb.stsci.edu/astroconda specviz


At this point, you’re done! You can launch SpecViz by typing the following at any terminal:



## Install via source¶

SpecViz can also be installed manually using the source code and requires the following dependencies to be installed on your system. Most of these will be handled automatically by the setup functions, with the exception of PyQt/PySide.

• Python 3 (recommended) or Python 2
• PyQt5 (recommended), PyQt4, or PySide
• Astropy
• Numpy
• Scipy
• PyQtGraph
• qtpy

### By using pip¶

Clone the SpecViz repository somewhere on your system, and install locally using pip. If you are using an Anaconda virtual environment, please be sure to activate it first before installing: $source activate <environment_name>. $ pip install git+http://github.com/spacetelescope/specviz.git@v0.4.4


This uses the pip installation system, so please note that

1. You need to have pip installed (included in most Python installations).
2. You do not need to run python setup.py install.
3. You do not need to install the dependencies by hand (except for PyQt).

Likewise, the pip command will use your default Python to install. You can specify by using pip2 or pip3, if you’re not using a virtual environment.

### By cloning¶

You may also install by cloning the repository directly

$git clone https://github.com/spacetelescope/specviz.git$ cd specviz
$git checkout tags/v0.3.0$ python setup.py install


### PyQt/PySide bindings¶

SpecViz requires PyQt. Currently, only python environments with 3.5 or higher installed can use pip to install PyQt5, in which case simply type:

$pip install pyqt5  to install it on your system. In any other case, PyQt can be installed via anaconda: $ conda install pyqt


SpecViz works with with PyQt4 and PySide, but it is recommended that users use PyQt5 if available.

### Uninstalling¶

To uninstall via pip, simply type the following at a command line:

$pip uninstall specviz  ## Known Issues¶ On a Mac with Qt5, depending on exactly how you have set up Anaconda, you might see the following error after following the above instructions: This application failed to start because it could not find or load the Qt platform plugin "cocoa". Reinstalling the application may fix this problem.  If you see this message, you have encountered an incompatibility between Anaconda’s packaging of Qt4 and Qt5. The workaround is to uninstall Qt4 with the following command: $ conda uninstall pyqt qt


and SpecViz should now happily run.

Conversely, if you’ve had PyQt5 installed previously and you wish to run the PyQt4 version, you may run into a similar error:

$RuntimeError: the PyQt4.QtCore and PyQt5.QtCore modules both wrap the QObject class  This issue can be solved with the following command: $ conda uninstall pyqt5 qt5