Skip to content

Commit 1e6cf96

Browse files
authored
DOC: Added documentation for ImportError's (#30912)
1 parent f49907f commit 1e6cf96

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/source/getting_started/install.rst

+17
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,23 @@ The commands in this table will install pandas for Python 3 from your distributi
163163
to get the newest version of pandas, it's recommended to install using the ``pip`` or ``conda``
164164
methods described above.
165165

166+
Handling ImportErrors
167+
~~~~~~~~~~~~~~~~~~~~~~
168+
169+
If you encounter an ImportError, it usually means that Python couldn't find pandas in the list of available
170+
libraries. Python internally has a list of directories it searches through, to find packages. You can
171+
obtain these directories with::
172+
173+
import sys
174+
sys.path
175+
176+
One way you could be encountering this error is if you have multiple Python installations on your system
177+
and you don't have pandas installed in the Python installation you're currently using.
178+
In Linux/Mac you can run ``which python`` on your terminal and it will tell you which Python installation you're
179+
using. If it's something like "/usr/bin/python", you're using the Python from the system, which is not recommended.
180+
181+
It is highly recommended to use ``conda``, for quick installation and for package and dependency updates.
182+
You can find simple installation instructions for pandas in this document: `installation instructions </getting_started.html>`.
166183

167184
Installing from source
168185
~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)