6
6
Installation
7
7
============
8
8
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:
14
11
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.
18
19
19
20
.. _install.version :
20
21
@@ -26,68 +27,54 @@ See :ref:`Python support policy <policies.python_support>`.
26
27
Installing pandas
27
28
-----------------
28
29
29
- .. _install.anaconda :
30
+ .. _install.conda :
30
31
31
- Installing with Anaconda
32
- ~~~~~~~~~~~~~~~~~~~~~~~~
32
+ Installing with Conda
33
+ ~~~~~~~~~~~~~~~~~~~~~
33
34
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.
42
37
43
- .. _ install.miniconda :
38
+ .. code-block :: shell
44
39
45
- Installing with Miniconda
46
- ~~~~~~~~~~~~~~~~~~~~~~~~~
40
+ conda install -c conda-forge pandas
47
41
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.
54
45
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.
58
47
59
48
.. code-block :: shell
60
49
61
50
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
68
52
source activate name_of_my_env
69
53
# On Windows
70
54
activate name_of_my_env
71
55
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.
73
64
74
- Installing from PyPI
75
- ~~~~~~~~~~~~~~~~~~~~
65
+ However, pandas from Anaconda is **not ** officially managed by the pandas development team.
76
66
77
- pandas can be installed via pip from
78
- `PyPI <https://pypi.org/project/pandas >`__.
67
+ .. _install.pip :
79
68
80
- .. code-block :: shell
81
-
82
- pip install pandas
69
+ Installing with pip
70
+ ~~~~~~~~~~~~~~~~~~~
83
71
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/ >`__ .
86
74
87
- .. note ::
75
+ .. code-block :: shell
88
76
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
91
78
92
79
pandas can also be installed with sets of optional dependencies to enable certain functionality. For example,
93
80
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.
98
85
99
86
The full list of extras that can be installed can be found in the :ref: `dependency section.<install.optional_dependencies> `
100
87
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 >`__
120
90
121
91
.. _install.source :
122
92
@@ -144,49 +114,24 @@ index from the PyPI registry of anaconda.org. You can install it by running.
144
114
145
115
pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple pandas
146
116
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.
148
119
149
- .. code-block :: shell
120
+ .. code-block :: shell
150
121
151
- pip uninstall pandas -y
122
+ pip uninstall pandas -y
152
123
153
124
Running the test suite
154
125
----------------------
155
126
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.
184
128
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]" ``.
185
131
186
132
.. note ::
187
133
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.
190
135
191
136
.. _install.dependencies :
192
137
@@ -219,7 +164,7 @@ For example, :func:`pandas.read_hdf` requires the ``pytables`` package, while
219
164
optional dependency is not installed, pandas will raise an ``ImportError `` when
220
165
the method requiring that dependency is called.
221
166
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)
223
168
as optional extras (e.g. ``pandas[performance, aws] ``). All optional dependencies can be installed with ``pandas[all] ``,
224
169
and specific sets of dependencies are listed in the sections below.
225
170
0 commit comments