Skip to content

Commit 406abd9

Browse files
authored
DOC: Simplify install.rst (pandas-dev#54175)
* DOC: Simplify install.rst * Final edits * Address review
1 parent e0964c2 commit 406abd9

File tree

1 file changed

+71
-135
lines changed

1 file changed

+71
-135
lines changed

doc/source/getting_started/install.rst

+71-135
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ Installation
77
============
88

99
The easiest way to install pandas is to install it
10-
as part of the `Anaconda <https://docs.continuum.io/anaconda/>`__ distribution, a
10+
as part of the `Anaconda <https://docs.continuum.io/free/anaconda/>`__ distribution, a
1111
cross platform distribution for data analysis and scientific computing.
12-
This is the recommended installation method for most users.
12+
The `Conda <https://conda.io/en/latest/>`__ package manager is the
13+
recommended installation method for most users.
1314

14-
Instructions for installing from source,
15-
`PyPI <https://pypi.org/project/pandas>`__, `ActivePython <https://www.activestate.com/products/python/>`__, various Linux distributions, or a
16-
`development version <https://github.com/pandas-dev/pandas>`__ are also provided.
15+
Instructions for installing :ref:`from source <install.source>`,
16+
:ref:`PyPI <install.pypi>`, or a
17+
:ref:`development version <install.dev>` are also provided.
1718

1819
.. _install.version:
1920

@@ -30,197 +31,135 @@ Installing pandas
3031
Installing with Anaconda
3132
~~~~~~~~~~~~~~~~~~~~~~~~
3233

33-
Installing pandas and the rest of the `NumPy <https://numpy.org/>`__ and
34-
`SciPy <https://scipy.org/>`__ stack can be a little
35-
difficult for inexperienced users.
36-
37-
The simplest way to install not only pandas, but Python and the most popular
38-
packages that make up the `SciPy <https://scipy.org/>`__ stack
39-
(`IPython <https://ipython.org/>`__, `NumPy <https://numpy.org/>`__,
40-
`Matplotlib <https://matplotlib.org/>`__, ...) is with
41-
`Anaconda <https://docs.continuum.io/anaconda/>`__, a cross-platform
34+
For users that are new to Python, the easiest way to install Python, pandas, and the
35+
packages that make up the `PyData <https://pydata.org/>`__ stack
36+
(`SciPy <https://scipy.org/>`__, `NumPy <https://numpy.org/>`__,
37+
`Matplotlib <https://matplotlib.org/>`__, `and more <https://docs.continuum.io/free/anaconda/reference/packages/pkg-docs/>`__)
38+
is with `Anaconda <https://docs.continuum.io/free/anaconda/>`__, a cross-platform
4239
(Linux, macOS, Windows) Python distribution for data analytics and
43-
scientific computing.
44-
45-
After running the installer, the user will have access to pandas and the
46-
rest of the `SciPy <https://scipy.org/>`__ stack without needing to install
47-
anything else, and without needing to wait for any software to be compiled.
48-
49-
Installation instructions for `Anaconda <https://docs.continuum.io/anaconda/>`__
50-
`can be found here <https://docs.continuum.io/anaconda/install/>`__.
51-
52-
A full list of the packages available as part of the
53-
`Anaconda <https://docs.continuum.io/anaconda/>`__ distribution
54-
`can be found here <https://docs.continuum.io/anaconda/packages/pkg-docs/>`__.
55-
56-
Another advantage to installing Anaconda is that you don't need
57-
admin rights to install it. Anaconda can install in the user's home directory,
58-
which makes it trivial to delete Anaconda if you decide (just delete
59-
that folder).
40+
scientific computing. Installation instructions for Anaconda
41+
`can be found here <https://docs.continuum.io/free/anaconda/install/>`__.
6042

6143
.. _install.miniconda:
6244

6345
Installing with Miniconda
6446
~~~~~~~~~~~~~~~~~~~~~~~~~
6547

66-
The previous section outlined how to get pandas installed as part of the
67-
`Anaconda <https://docs.continuum.io/anaconda/>`__ distribution.
68-
However this approach means you will install well over one hundred packages
69-
and involves downloading the installer which is a few hundred megabytes in size.
70-
71-
If you want to have more control on which packages, or have a limited internet
72-
bandwidth, then installing pandas with
73-
`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`__ may be a better solution.
74-
75-
`Conda <https://conda.io/en/latest/>`__ is the package manager that the
76-
`Anaconda <https://docs.continuum.io/anaconda/>`__ distribution is built upon.
77-
It is a package manager that is both cross-platform and language agnostic
78-
(it can play a similar role to a pip and virtualenv combination).
79-
80-
`Miniconda <https://conda.pydata.org/miniconda.html>`__ allows you to create a
81-
minimal self contained Python installation, and then use the
82-
`Conda <https://conda.io/en/latest/>`__ command to install additional packages.
83-
84-
First you will need `Conda <https://conda.io/en/latest/>`__ to be installed and
85-
downloading and running the `Miniconda
86-
<https://conda.pydata.org/miniconda.html>`__
87-
will do this for you. The installer
88-
`can be found here <https://conda.pydata.org/miniconda.html>`__
48+
For users experienced with Python, the recommended way to install pandas with
49+
`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`__.
50+
Miniconda allows you to create a minimal, self-contained Python installation compared to Anaconda and use the
51+
`Conda <https://conda.io/en/latest/>`__ package manager to install additional packages
52+
and create a virtual environment for your installation. Installation instructions for Miniconda
53+
`can be found here <https://docs.conda.io/en/latest/miniconda.html>`__.
8954

9055
The next step is to create a new conda environment. A conda environment is like a
9156
virtualenv that allows you to specify a specific version of Python and set of libraries.
92-
Run the following commands from a terminal window::
57+
Run the following commands from a terminal window.
9358

94-
conda create -n name_of_my_env python
59+
.. code-block:: shell
9560
96-
This will create a minimal environment with only Python installed in it.
97-
To put your self inside this environment run::
61+
conda create -c conda-forge -n name_of_my_env python pandas
9862
99-
source activate name_of_my_env
63+
This will create a minimal environment with only Python and pandas installed.
64+
To put your self inside this environment run.
10065

101-
On Windows the command is::
66+
.. code-block:: shell
10267
68+
source activate name_of_my_env
69+
# On Windows
10370
activate name_of_my_env
10471
105-
The final step required is to install pandas. This can be done with the
106-
following command::
107-
108-
conda install pandas
109-
110-
To install a specific pandas version::
111-
112-
conda install pandas=0.20.3
113-
114-
To install other packages, IPython for example::
115-
116-
conda install ipython
117-
118-
To install the full `Anaconda <https://docs.continuum.io/anaconda/>`__
119-
distribution::
120-
121-
conda install anaconda
122-
123-
If you need packages that are available to pip but not conda, then
124-
install pip, and then use pip to install those packages::
125-
126-
conda install pip
127-
pip install django
72+
.. _install.pypi:
12873

12974
Installing from PyPI
13075
~~~~~~~~~~~~~~~~~~~~
13176

13277
pandas can be installed via pip from
13378
`PyPI <https://pypi.org/project/pandas>`__.
13479

80+
.. code-block:: shell
81+
82+
pip install pandas
83+
13584
.. note::
13685
You must have ``pip>=19.3`` to install from PyPI.
13786

138-
::
87+
.. note::
13988

140-
pip install pandas
89+
It is recommended to install and run pandas from a virtual environment, for example,
90+
using the Python standard library's `venv <https://docs.python.org/3/library/venv.html>`__
14191

14292
pandas can also be installed with sets of optional dependencies to enable certain functionality. For example,
14393
to install pandas with the optional dependencies to read Excel files.
14494

145-
::
95+
.. code-block:: shell
14696
14797
pip install "pandas[excel]"
14898
149-
15099
The full list of extras that can be installed can be found in the :ref:`dependency section.<install.optional_dependencies>`
151100

152-
Installing using your Linux distribution's package manager.
153-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154-
155-
The commands in this table will install pandas for Python 3 from your distribution.
156-
157-
.. csv-table::
158-
:header: "Distribution", "Status", "Download / Repository Link", "Install method"
159-
:widths: 10, 10, 20, 50
160-
161-
162-
Debian, stable, `official Debian repository <https://packages.debian.org/search?keywords=pandas&searchon=names&suite=all&section=all>`__ , ``sudo apt-get install python3-pandas``
163-
Debian & Ubuntu, unstable (latest packages), `NeuroDebian <https://neuro.debian.net/index.html#how-to-use-this-repository>`__ , ``sudo apt-get install python3-pandas``
164-
Ubuntu, stable, `official Ubuntu repository <https://packages.ubuntu.com/search?keywords=pandas&searchon=names&suite=all&section=all>`__ , ``sudo apt-get install python3-pandas``
165-
OpenSuse, stable, `OpenSuse Repository <https://software.opensuse.org/package/python-pandas?search_term=pandas>`__ , ``zypper in python3-pandas``
166-
Fedora, stable, `official Fedora repository <https://src.fedoraproject.org/rpms/python-pandas>`__ , ``dnf install python3-pandas``
167-
Centos/RHEL, stable, `EPEL repository <https://admin.fedoraproject.org/pkgdb/package/rpms/python-pandas/>`__ , ``yum install python3-pandas``
168-
169-
**However**, the packages in the linux package managers are often a few versions behind, so
170-
to get the newest version of pandas, it's recommended to install using the ``pip`` or ``conda``
171-
methods described above.
172-
173101
Handling ImportErrors
174-
~~~~~~~~~~~~~~~~~~~~~~
102+
~~~~~~~~~~~~~~~~~~~~~
175103

176-
If you encounter an ImportError, it usually means that Python couldn't find pandas in the list of available
104+
If you encounter an ``ImportError``, it usually means that Python couldn't find pandas in the list of available
177105
libraries. Python internally has a list of directories it searches through, to find packages. You can
178-
obtain these directories with::
106+
obtain these directories with.
107+
108+
.. code-block:: python
179109
180-
import sys
181-
sys.path
110+
import sys
111+
sys.path
182112
183113
One way you could be encountering this error is if you have multiple Python installations on your system
184114
and you don't have pandas installed in the Python installation you're currently using.
185115
In Linux/Mac you can run ``which python`` on your terminal and it will tell you which Python installation you're
186116
using. If it's something like "/usr/bin/python", you're using the Python from the system, which is not recommended.
187117

188118
It is highly recommended to use ``conda``, for quick installation and for package and dependency updates.
189-
You can find simple installation instructions for pandas in this document: ``installation instructions </getting_started.html>``.
119+
You can find simple installation instructions for pandas :ref:`in this document <install.miniconda>`.
120+
121+
.. _install.source:
190122

191123
Installing from source
192124
~~~~~~~~~~~~~~~~~~~~~~
193125

194-
See the :ref:`contributing guide <contributing>` for complete instructions on building from the git source tree. Further, see :ref:`creating a development environment <contributing_environment>` if you wish to create a pandas development environment.
126+
See the :ref:`contributing guide <contributing>` for complete instructions on building from the git source tree.
127+
Further, see :ref:`creating a development environment <contributing_environment>` if you wish to create
128+
a pandas development environment.
129+
130+
.. _install.dev:
195131

196132
Installing the development version of pandas
197133
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
198134

199-
Installing a nightly build is the quickest way to:
135+
Installing the development version is the quickest way to:
200136

201137
* Try a new feature that will be shipped in the next release (that is, a feature from a pull-request that was recently merged to the main branch).
202138
* Check whether a bug you encountered has been fixed since the last release.
203139

204-
You can install the nightly build of pandas using the scientific-python-nightly-wheels index from the PyPI registry of anaconda.org with the following command::
140+
The development version is usually uploaded daily to the scientific-python-nightly-wheels
141+
index from the PyPI registry of anaconda.org. You can install it by running.
142+
143+
.. code-block:: shell
205144
206145
pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple pandas
207146
208-
Note that first uninstalling pandas might be required to be able to install nightly builds::
147+
Note that you might be required to uninstall an existing version of pandas to install the development version.
148+
149+
.. code-block:: shell
209150
210151
pip uninstall pandas -y
211152
212153
Running the test suite
213154
----------------------
214155

215-
pandas is equipped with an exhaustive set of unit tests, covering about 97% of
216-
the code base as of this writing. To run it on your machine to verify that
217-
everything is working (and that you have all of the dependencies, soft and hard,
218-
installed), make sure you have `pytest
219-
<https://docs.pytest.org/en/latest/>`__ >= 7.3.2 and `Hypothesis
220-
<https://hypothesis.readthedocs.io/en/latest/>`__ >= 6.34.2, then run:
156+
pandas is equipped with an exhaustive set of unit tests. The packages required to run the tests
157+
can be installed with ``pip install "pandas[test]"``. To run the tests from a
158+
Python terminal.
221159

222-
::
160+
.. code-block:: python
223161
162+
>>> import pandas as pd
224163
>>> pd.test()
225164
running: pytest -m "not slow and not network and not db" /home/user/anaconda3/lib/python3.9/site-packages/pandas
226165
@@ -243,7 +182,11 @@ installed), make sure you have `pytest
243182
244183
= 1 failed, 146194 passed, 7402 skipped, 1367 xfailed, 5 xpassed, 197 warnings, 10 errors in 1090.16s (0:18:10) =
245184
246-
This is just an example of what information is shown. You might see a slightly different result as what is shown above.
185+
186+
.. note::
187+
188+
This is just an example of what information is shown. Test failures are not necessarily indicative
189+
of a broken pandas installation.
247190

248191
.. _install.dependencies:
249192

@@ -424,15 +367,8 @@ odfpy 1.4.1 excel Open document form
424367
.. warning::
425368

426369
* If you want to use :func:`~pandas.read_orc`, it is highly recommended to install pyarrow using conda.
427-
The following is a summary of the environment in which :func:`~pandas.read_orc` can work.
428-
429-
========================= ================== =============================================================
430-
System Conda PyPI
431-
========================= ================== =============================================================
432-
Linux Successful Failed
433-
macOS Successful Failed
434-
Windows Failed Failed
435-
========================= ================== =============================================================
370+
:func:`~pandas.read_orc` may fail if pyarrow was installed from pypi, and :func:`~pandas.read_orc` is
371+
not compatible with Windows OS.
436372

437373
Access data in the cloud
438374
^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)