Skip to content

Commit b96491a

Browse files
authored
DOC: Emphasize team managed pandas in installation docs (pandas-dev#59822)
* DOC: Emphasize team managed pandas in installation docs * grammar
1 parent a92b919 commit b96491a

File tree

7 files changed

+52
-133
lines changed

7 files changed

+52
-133
lines changed

doc/source/development/maintaining.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ in the next places:
344344
- Git repo with a `new tag <https://github.com/pandas-dev/pandas/tags>`_
345345
- Source distribution in a `GitHub release <https://github.com/pandas-dev/pandas/releases>`_
346346
- Pip packages in the `PyPI <https://pypi.org/project/pandas/>`_
347-
- Conda/Mamba packages in `conda-forge <https://anaconda.org/conda-forge/pandas>`_
347+
- Conda packages in `conda-forge <https://anaconda.org/conda-forge/pandas>`_
348348

349349
The process for releasing a new version of pandas is detailed next section.
350350

doc/source/getting_started/index.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ Installation
1717
:columns: 12 12 6 6
1818
:padding: 3
1919

20-
pandas is part of the `Anaconda <https://docs.continuum.io/anaconda/>`__
21-
distribution and can be installed with Anaconda or Miniconda:
20+
pandas can be installed via conda from `conda-forge <https://anaconda.org/conda-forge/pandas>`__.
2221

2322
++++++++++++++++++++++
2423

doc/source/getting_started/install.rst

+48-103
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
Installation
77
============
88

9-
The easiest way to install pandas is to install it
10-
as part of the `Anaconda <https://docs.continuum.io/free/anaconda/>`__ distribution, a
11-
cross platform distribution for data analysis and scientific computing.
12-
The `Conda <https://conda.io/en/latest/>`__ package manager is the
13-
recommended installation method for most users.
9+
The pandas development team officially distributes pandas for installation
10+
through the following methods:
1411

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.
12+
* Available on `conda-forge <https://anaconda.org/conda-forge/pandas>`__ for installation with the conda package manager.
13+
* Available on `PyPI <https://pypi.org/project/pandas/>`__ for installation with pip.
14+
* Available on `Github <https://github.com/pandas-dev/pandas>`__ for installation from source.
15+
16+
.. note::
17+
pandas may be installable from other sources besides the ones listed above,
18+
but they are **not** managed by the pandas development team.
1819

1920
.. _install.version:
2021

@@ -26,68 +27,54 @@ See :ref:`Python support policy <policies.python_support>`.
2627
Installing pandas
2728
-----------------
2829

29-
.. _install.anaconda:
30+
.. _install.conda:
3031

31-
Installing with Anaconda
32-
~~~~~~~~~~~~~~~~~~~~~~~~
32+
Installing with Conda
33+
~~~~~~~~~~~~~~~~~~~~~
3334

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
39-
(Linux, macOS, Windows) Python distribution for data analytics and
40-
scientific computing. Installation instructions for Anaconda
41-
`can be found here <https://docs.continuum.io/free/anaconda/install/>`__.
35+
For users working with the `Conda <https://conda.io/en/latest/>`__ package manager,
36+
pandas can be installed from the ``conda-forge`` channel.
4237

43-
.. _install.miniconda:
38+
.. code-block:: shell
4439
45-
Installing with Miniconda
46-
~~~~~~~~~~~~~~~~~~~~~~~~~
40+
conda install -c conda-forge pandas
4741
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>`__.
42+
To install the Conda package manager on your system, the
43+
`Miniforge distribution <https://github.com/conda-forge/miniforge?tab=readme-ov-file#install>`__
44+
is recommended.
5445

55-
The next step is to create a new conda environment. A conda environment is like a
56-
virtualenv that allows you to specify a specific version of Python and set of libraries.
57-
Run the following commands from a terminal window.
46+
Additionally, it is recommended to install and run pandas from a virtual environment.
5847

5948
.. code-block:: shell
6049
6150
conda create -c conda-forge -n name_of_my_env python pandas
62-
63-
This will create a minimal environment with only Python and pandas installed.
64-
To put your self inside this environment run.
65-
66-
.. code-block:: shell
67-
51+
# On Linux or MacOS
6852
source activate name_of_my_env
6953
# On Windows
7054
activate name_of_my_env
7155
72-
.. _install.pypi:
56+
.. tip::
57+
For users that are new to Python, the easiest way to install Python, pandas, and the
58+
packages that make up the `PyData <https://pydata.org/>`__ stack such as
59+
`SciPy <https://scipy.org/>`__, `NumPy <https://numpy.org/>`__ and
60+
`Matplotlib <https://matplotlib.org/>`__
61+
is with `Anaconda <https://docs.anaconda.com/anaconda/install/>`__, a cross-platform
62+
(Linux, macOS, Windows) Python distribution for data analytics and
63+
scientific computing.
7364

74-
Installing from PyPI
75-
~~~~~~~~~~~~~~~~~~~~
65+
However, pandas from Anaconda is **not** officially managed by the pandas development team.
7666

77-
pandas can be installed via pip from
78-
`PyPI <https://pypi.org/project/pandas>`__.
67+
.. _install.pip:
7968

80-
.. code-block:: shell
81-
82-
pip install pandas
69+
Installing with pip
70+
~~~~~~~~~~~~~~~~~~~
8371

84-
.. note::
85-
You must have ``pip>=19.3`` to install from PyPI.
72+
For users working with the `pip <https://pip.pypa.io/en/stable/>`__ package manager,
73+
pandas can be installed from `PyPI <https://pypi.org/project/pandas/>`__.
8674

87-
.. note::
75+
.. code-block:: shell
8876
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>`__
77+
pip install pandas
9178
9279
pandas can also be installed with sets of optional dependencies to enable certain functionality. For example,
9380
to install pandas with the optional dependencies to read Excel files.
@@ -98,25 +85,8 @@ to install pandas with the optional dependencies to read Excel files.
9885
9986
The full list of extras that can be installed can be found in the :ref:`dependency section.<install.optional_dependencies>`
10087

101-
Handling ImportErrors
102-
~~~~~~~~~~~~~~~~~~~~~
103-
104-
If you encounter an ``ImportError``, it usually means that Python couldn't find pandas in the list of available
105-
libraries. Python internally has a list of directories it searches through, to find packages. You can
106-
obtain these directories with.
107-
108-
.. code-block:: python
109-
110-
import sys
111-
sys.path
112-
113-
One way you could be encountering this error is if you have multiple Python installations on your system
114-
and you don't have pandas installed in the Python installation you're currently using.
115-
In Linux/Mac you can run ``which python`` on your terminal and it will tell you which Python installation you're
116-
using. If it's something like "/usr/bin/python", you're using the Python from the system, which is not recommended.
117-
118-
It is highly recommended to use ``conda``, for quick installation and for package and dependency updates.
119-
You can find simple installation instructions for pandas :ref:`in this document <install.miniconda>`.
88+
Additionally, it is recommended to install and run pandas from a virtual environment, for example,
89+
using the Python standard library's `venv <https://docs.python.org/3/library/venv.html>`__
12090

12191
.. _install.source:
12292

@@ -144,49 +114,24 @@ index from the PyPI registry of anaconda.org. You can install it by running.
144114
145115
pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple pandas
146116
147-
Note that you might be required to uninstall an existing version of pandas to install the development version.
117+
.. note::
118+
You might be required to uninstall an existing version of pandas to install the development version.
148119

149-
.. code-block:: shell
120+
.. code-block:: shell
150121
151-
pip uninstall pandas -y
122+
pip uninstall pandas -y
152123
153124
Running the test suite
154125
----------------------
155126

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.
159-
160-
.. code-block:: python
161-
162-
>>> import pandas as pd
163-
>>> pd.test()
164-
running: pytest -m "not slow and not network and not db" /home/user/anaconda3/lib/python3.10/site-packages/pandas
165-
166-
============================= test session starts ==============================
167-
platform linux -- Python 3.9.7, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
168-
rootdir: /home/user
169-
plugins: dash-1.19.0, anyio-3.5.0, hypothesis-6.29.3
170-
collected 154975 items / 4 skipped / 154971 selected
171-
........................................................................ [ 0%]
172-
........................................................................ [ 99%]
173-
....................................... [100%]
174-
175-
==================================== ERRORS ====================================
176-
177-
=================================== FAILURES ===================================
178-
179-
=============================== warnings summary ===============================
180-
181-
=========================== short test summary info ============================
182-
183-
= 1 failed, 146194 passed, 7402 skipped, 1367 xfailed, 5 xpassed, 197 warnings, 10 errors in 1090.16s (0:18:10) =
127+
If pandas has been installed :ref:`from source <install.source>`, running ``pytest pandas`` will run all of pandas unit tests.
184128

129+
The unit tests can also be run from the pandas module itself with the :func:`test` function. The packages required to run the tests
130+
can be installed with ``pip install "pandas[test]"``.
185131

186132
.. note::
187133

188-
This is just an example of what information is shown. Test failures are not necessarily indicative
189-
of a broken pandas installation.
134+
Test failures are not necessarily indicative of a broken pandas installation.
190135

191136
.. _install.dependencies:
192137

@@ -219,7 +164,7 @@ For example, :func:`pandas.read_hdf` requires the ``pytables`` package, while
219164
optional dependency is not installed, pandas will raise an ``ImportError`` when
220165
the method requiring that dependency is called.
221166

222-
If using pip, optional pandas dependencies can be installed or managed in a file (e.g. requirements.txt or pyproject.toml)
167+
With pip, optional pandas dependencies can be installed or managed in a file (e.g. requirements.txt or pyproject.toml)
223168
as optional extras (e.g. ``pandas[performance, aws]``). All optional dependencies can be installed with ``pandas[all]``,
224169
and specific sets of dependencies are listed in the sections below.
225170

web/pandas/getting_started.md

+2-27
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,8 @@
22

33
## Installation instructions
44

5-
The next steps provides the easiest and recommended way to set up your
6-
environment to use pandas. Other installation options can be found in
7-
the [advanced installation page]({{ base_url}}docs/getting_started/install.html).
8-
9-
1. Download [Anaconda](https://www.anaconda.com/download/) for your operating system and
10-
the latest Python version, run the installer, and follow the steps. Please note:
11-
12-
- It is not needed (and discouraged) to install Anaconda as root or administrator.
13-
- When asked if you wish to initialize Anaconda3, answer yes.
14-
- Restart the terminal after completing the installation.
15-
16-
Detailed instructions on how to install Anaconda can be found in the
17-
[Anaconda documentation](https://docs.anaconda.com/anaconda/install/).
18-
19-
2. In the Anaconda prompt (or terminal in Linux or macOS), start JupyterLab:
20-
21-
<img class="img-fluid" alt="" src="{{ base_url }}/static/img/install/anaconda_prompt.png"/>
22-
23-
3. In JupyterLab, create a new (Python 3) notebook:
24-
25-
<img class="img-fluid" alt="" src="{{ base_url }}/static/img/install/jupyterlab_home.png"/>
26-
27-
4. In the first cell of the notebook, you can import pandas and check the version with:
28-
29-
<img class="img-fluid" alt="" src="{{ base_url }}/static/img/install/pandas_import_and_version.png"/>
30-
31-
5. Now you are ready to use pandas, and you can write your code in the next cells.
5+
To install pandas, please reference the [installation page]({{ base_url}}docs/getting_started/install.html)
6+
from the pandas documentation.
327

338
## Tutorials
349

-1.34 KB
Binary file not shown.
-1.92 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)