Skip to content

Commit 3859dfa

Browse files
Merge pull request #474 from matthew-brett/better-installation-advice
MRG: better installation instructions Don't advise sudo, it's a terrible idea. Make clear the difference between a "source" install and a "development" install.
2 parents 758e07f + 24223f7 commit 3859dfa

File tree

1 file changed

+32
-34
lines changed

1 file changed

+32
-34
lines changed

doc/source/installation.rst

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ the source from `NiBabel pypi`_ . Go to the pypi page and select the source
4848
distribution you want. Download the distribution, unpack it, and then, from
4949
the unpacked directory, run::
5050

51-
python setup.py install
51+
pip install .
5252

53-
or (if you need root permission to install on a unix system)::
53+
If you get permission errors, this may be because ``pip`` is trying to install
54+
to the system directories. You can solve this error by using ``sudo``, but we
55+
strongly suggest you either do an install into your "user" directories, like
56+
this::
5457

55-
sudo python setup.py install
58+
pip install --user .
59+
60+
or you work inside a virtualenv_.
5661

5762
.. _install_debian:
5863

@@ -66,60 +71,51 @@ their repositories. Once this is done, installing NiBabel is::
6671
apt-get update
6772
apt-get install python-nibabel
6873

69-
Install from source
70-
===================
74+
Install a development version
75+
=============================
7176

72-
If no installer or package is provided for your platform, you can install
73-
NiBabel from source.
77+
If you want to test the latest development version of nibabel, or you'd like to
78+
help by contributing bug-fixes or new features (excellent!), then this section
79+
is for you.
7480

7581
Requirements
7682
------------
7783

7884
* Python_ 2.6 or greater
7985
* NumPy_ 1.5 or greater
80-
* SciPy_ (for full SPM-ANALYZE support)
81-
* PyDICOM_ 0.9.7 or greater (for DICOM support)
82-
* `Python Imaging Library`_ (for PNG conversion in DICOMFS)
83-
* nose_ 0.11 or greater (to run the tests)
84-
* sphinx_ (to build the documentation)
85-
86-
Get the sources
87-
---------------
86+
* SciPy_ (optional, for full SPM-ANALYZE support)
87+
* PyDICOM_ 0.9.7 or greater (optional, for DICOM support)
88+
* `Python Imaging Library`_ (optional, for PNG conversion in DICOMFS)
89+
* nose_ 0.11 or greater (optional, to run the tests)
90+
* sphinx_ (optional, to build the documentation)
8891

89-
The latest release is always available from `NiBabel pypi`_.
92+
Get the development sources
93+
---------------------------
9094

91-
Alternatively, you can download a tarball of the latest development snapshot
92-
(i.e. the current state of the *master* branch of the NiBabel source code
93-
repository) from the `NiBabel github`_ page.
95+
You can download a tarball of the latest development snapshot (i.e. the current
96+
state of the *master* branch of the NiBabel source code repository) from the
97+
`NiBabel github`_ page.
9498

9599
If you want to have access to the full NiBabel history and the latest
96-
development code, do a full clone (aka checkout) of the NiBabel
100+
development code, do a full clone (AKA checkout) of the NiBabel
97101
repository::
98102

99-
git clone git://github.com/nipy/nibabel.git
100-
101-
or::
102-
103103
git clone https://github.com/nipy/nibabel.git
104104

105-
(The first may be faster, the second more likely to work behind a firewall).
106-
107105
Installation
108106
------------
109107

110108
Just install the modules by invoking::
111109

112-
sudo python setup.py install
113-
114-
If sudo is not configured (or even installed) you might have to use
115-
``su`` instead.
110+
pip install .
116111

112+
See :ref:`install-pypi` for advice on what to do for permission errors.
117113

118114
Validating your install
119115
-----------------------
120116

121-
For a basic test of your installation, fire up Python and try importing the module to see if everything is fine.
122-
It should look something like this::
117+
For a basic test of your installation, fire up Python and try importing the
118+
module to see if everything is fine. It should look something like this::
123119

124120
Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35)
125121
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
@@ -128,8 +124,10 @@ It should look something like this::
128124
>>>
129125

130126

131-
To run the nibabel test suite, from the terminal run ``nosetests nibabel`` or ``python -c "import nibabel; nibabel.test()``.
127+
To run the nibabel test suite, from the terminal run ``nosetests nibabel`` or
128+
``python -c "import nibabel; nibabel.test()``.
132129

133-
To run an extended test suite that validates ``nibabel`` for long-running and resource-intensive cases, please see :ref:`advanced_testing`.
130+
To run an extended test suite that validates ``nibabel`` for long-running and
131+
resource-intensive cases, please see :ref:`advanced_testing`.
134132

135133
.. include:: links_names.txt

0 commit comments

Comments
 (0)