@@ -7,13 +7,14 @@ Installation
7
7
============
8
8
9
9
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
11
11
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.
13
14
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.
17
18
18
19
.. _install.version :
19
20
@@ -30,197 +31,135 @@ Installing pandas
30
31
Installing with Anaconda
31
32
~~~~~~~~~~~~~~~~~~~~~~~~
32
33
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
42
39
(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/ >`__.
60
42
61
43
.. _install.miniconda :
62
44
63
45
Installing with Miniconda
64
46
~~~~~~~~~~~~~~~~~~~~~~~~~
65
47
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 >`__.
89
54
90
55
The next step is to create a new conda environment. A conda environment is like a
91
56
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.
93
58
94
- conda create -n name_of_my_env python
59
+ .. code-block :: shell
95
60
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
98
62
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.
100
65
101
- On Windows the command is::
66
+ .. code-block :: shell
102
67
68
+ source activate name_of_my_env
69
+ # On Windows
103
70
activate name_of_my_env
104
71
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 :
128
73
129
74
Installing from PyPI
130
75
~~~~~~~~~~~~~~~~~~~~
131
76
132
77
pandas can be installed via pip from
133
78
`PyPI <https://pypi.org/project/pandas >`__.
134
79
80
+ .. code-block :: shell
81
+
82
+ pip install pandas
83
+
135
84
.. note ::
136
85
You must have ``pip>=19.3 `` to install from PyPI.
137
86
138
- ::
87
+ .. note ::
139
88
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 >`__
141
91
142
92
pandas can also be installed with sets of optional dependencies to enable certain functionality. For example,
143
93
to install pandas with the optional dependencies to read Excel files.
144
94
145
- ::
95
+ .. code-block :: shell
146
96
147
97
pip install " pandas[excel]"
148
98
149
-
150
99
The full list of extras that can be installed can be found in the :ref: `dependency section.<install.optional_dependencies> `
151
100
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§ion=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§ion=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
-
173
101
Handling ImportErrors
174
- ~~~~~~~~~~~~~~~~~~~~~~
102
+ ~~~~~~~~~~~~~~~~~~~~~
175
103
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
177
105
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
179
109
180
- import sys
181
- sys.path
110
+ import sys
111
+ sys.path
182
112
183
113
One way you could be encountering this error is if you have multiple Python installations on your system
184
114
and you don't have pandas installed in the Python installation you're currently using.
185
115
In Linux/Mac you can run ``which python `` on your terminal and it will tell you which Python installation you're
186
116
using. If it's something like "/usr/bin/python", you're using the Python from the system, which is not recommended.
187
117
188
118
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 :
190
122
191
123
Installing from source
192
124
~~~~~~~~~~~~~~~~~~~~~~
193
125
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 :
195
131
196
132
Installing the development version of pandas
197
133
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
198
134
199
- Installing a nightly build is the quickest way to:
135
+ Installing the development version is the quickest way to:
200
136
201
137
* 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).
202
138
* Check whether a bug you encountered has been fixed since the last release.
203
139
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
205
144
206
145
pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple pandas
207
146
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
209
150
210
151
pip uninstall pandas -y
211
152
212
153
Running the test suite
213
154
----------------------
214
155
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.
221
159
222
- ::
160
+ .. code-block :: python
223
161
162
+ >> > import pandas as pd
224
163
>> > pd.test()
225
164
running: pytest - m " not slow and not network and not db" / home/ user/ anaconda3/ lib/ python3.9/ site- packages/ pandas
226
165
@@ -243,7 +182,11 @@ installed), make sure you have `pytest
243
182
244
183
= 1 failed, 146194 passed, 7402 skipped, 1367 xfailed, 5 xpassed, 197 warnings, 10 errors in 1090. 16s (0 :18 :10 ) =
245
184
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.
247
190
248
191
.. _install.dependencies :
249
192
@@ -424,15 +367,8 @@ odfpy 1.4.1 excel Open document form
424
367
.. warning ::
425
368
426
369
* 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.
436
372
437
373
Access data in the cloud
438
374
^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments