5
5
Installing and Getting Started
6
6
==============================
7
7
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 ::
9
9
10
10
pip install pysurfer
11
11
12
12
If you already have PySurfer installed, you can also use pip to update it::
13
13
14
- pip install -U pysurfer
14
+ pip install -U --no-deps pysurfer
15
15
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::
18
17
19
- pip install -U pysurfer[save_movie]
18
+ pip install pysurfer[save_movie]
20
19
21
20
If you'd like to install the development version, you have two options. You can
22
- use pip ::
21
+ install straight from github ::
23
22
24
- pip install git+git ://github.com/nipy/pysurfer.git#egg=pysurfer
23
+ pip install https ://api. github.com/repos/ nipy/PySurfer/zipball/master
25
24
26
25
Or 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::
28
27
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 .
33
29
34
30
Dependencies
35
31
~~~~~~~~~~~~
36
32
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.)
38
35
39
36
To use PySurfer, you will need to have the following Python packages:
40
37
@@ -44,39 +41,36 @@ To use PySurfer, you will need to have the following Python packages:
44
41
* mayavi _
45
42
* matplotlib _
46
43
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.
61
46
62
47
Getting started
63
48
~~~~~~~~~~~~~~~
64
49
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
+
65
57
PySurfer 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.::
69
60
70
61
export QT_API=pyqt
62
+ export ETS_TOOLKIT=qt4
71
63
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.
74
65
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.
76
69
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::
80
74
81
75
%gui qt
82
76
0 commit comments