55Installing and Getting Started
66==============================
77
8- Installing PySurfer is quite simple with pip _::
8+ PySurfer can be installed with pip _. Note that the package name on PyPi is different from the library name that you import ::
99
1010 pip install pysurfer
1111
1212If you already have PySurfer installed, you can also use pip to update it::
1313
14- pip install -U pysurfer
14+ pip install -U --no-deps pysurfer
1515
16- If you would like to save movies of time course data, also include the
17- optional dependency `imageio ` with::
16+ If you would like to save movies of time course data, it is necessary to include the optional dependency ``imageio `` with::
1817
19- pip install -U pysurfer[save_movie]
18+ pip install pysurfer[save_movie]
2019
2120If you'd like to install the development version, you have two options. You can
22- use pip ::
21+ install straight from github ::
2322
24- pip install git+git ://github.com/nipy/pysurfer.git#egg=pysurfer
23+ pip install https ://api. github.com/repos/ nipy/PySurfer/zipball/master
2524
2625Or you can clone the `git repository <https://github.com/nipy/PySurfer >`_ and
27- install from the source directory::
26+ install from your local source directory::
2827
29- python setup.py install
30-
31- If you don't have pip, you can also install PySurfer with easy_install _, or use
32- easy_install to get pip.
28+ pip install .
3329
3430Dependencies
3531~~~~~~~~~~~~
3632
37- PySurfer requires Python 2.7, and it does not work on Python 3.
33+ PySurfer works on Python 2.7 and 3.6+.
34+ (Older Python 3 versions will probably work, but are not tested.)
3835
3936To use PySurfer, you will need to have the following Python packages:
4037
@@ -44,39 +41,36 @@ To use PySurfer, you will need to have the following Python packages:
4441* mayavi _
4542* matplotlib _
4643
47- Some functions also make use of the Python Imaging Library (PIL _), although
48- it's not mandatory.
49-
50- An easy option to set up this environment is the Anaconda _ distribution, which
51- is free and ships with many of the required packages. If you use Anaconda,
52- you'll need to install Mayavi separately. This can be done using the ``conda ``
53- command::
54-
55- conda install mayavi
56-
57- You'll also need to install nibabel, which can be done using ``pip `` as above.
58-
59- Another option for getting set up is the Enthough Canopy _ environment, which is
60- similar to Anaconda and free for academic use.
44+ Some input/output functions also make use of the Python Imaging Library (PIL _)
45+ and ``imageio ``, although they are not mandatory.
6146
6247Getting started
6348~~~~~~~~~~~~~~~
6449
50+ Because PySurfer relies on some complicated dependencies (Mayavi, VTK and a GUI
51+ library), it can be more difficult to get started with than is the case with
52+ other Python libraries. Consider using the Anaconda _ distribution
53+ or Enthough Canopy _ environment. The difficulty on these
54+ platforms is generally getting Mayavi and VTK installed; see their
55+ installation instructions for information.
56+
6557PySurfer generally works out of the box on Linux systems. Getting started on
66- OSX can be a bit more difficult. We have had success using the Anaconda
67- distribution with the additional step of setting the environment variable
68- ``QT_API `` to ``pyqt ``::
58+ OSX may be trickier. We have had success using the Anaconda distribution with
59+ the additional step of setting the environment variables ``QT_API `` and ``ETS_TOOLKIT ``, e.g.::
6960
7061 export QT_API=pyqt
62+ export ETS_TOOLKIT=qt4
7163
72- If you're using Canopy, you need to do something similar with the
73- ``ETS_TOOLKIT `` variable::
64+ The values you set should match the GUI library you are using.
7465
75- export ETS_TOOLKIT=qt4
66+ You may wish to consult the `Mayavi installation docs
67+ <http://docs.enthought.com/mayavi/mayavi/installation.html> `_ if you are having
68+ trouble getting things working.
7669
77- If you want to use PySurfer interactively, you should do so in ipython _. After
78- starting ipython (either in the terminal, qtconsole, or notebook), you have to
79- activate the correct GUI backend, which is probably qt::
70+ If you are using PySurfer interactively in IPython _/Jupyter, you should
71+ activate one of the GUI event loops so that the Mayavi window runs in a
72+ separate process. After starting IPython (either in the terminal, qtconsole, or
73+ notebook), you have to activate the correct GUI backend, which is probably qt::
8074
8175 %gui qt
8276
0 commit comments