Skip to content

Fix highlighting of install docs. #30375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions doc/install/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.. redirect-from:: /users/installing
.. redirect-from:: /users/installing/index

.. highlight:: sh

************
Installation
************
Expand All @@ -11,9 +13,7 @@ Install an official release

Matplotlib releases are available as wheel packages for macOS, Windows and
Linux on `PyPI <https://pypi.org/project/matplotlib/>`_. Install it using
``pip``:

.. code-block:: sh
``pip``::

python -m pip install -U pip
python -m pip install -U matplotlib
Expand Down Expand Up @@ -44,15 +44,11 @@ Various third-parties provide Matplotlib for their environments.
Conda packages
--------------

Matplotlib is available both via the *anaconda main channel*

.. code-block:: sh
Matplotlib is available both via the *anaconda main channel* ::

conda install matplotlib

as well as via the *conda-forge community channel*

.. code-block:: sh
as well as via the *conda-forge community channel* ::

conda install -c conda-forge matplotlib

Expand All @@ -62,10 +58,8 @@ Python distributions
Matplotlib is part of major Python distributions:

- `Anaconda <https://www.anaconda.com/>`_

- `ActiveState ActivePython
<https://www.activestate.com/products/python/downloads/>`_

- `WinPython <https://winpython.github.io/>`_

Linux package manager
Expand All @@ -90,9 +84,7 @@ Matplotlib makes nightly development build wheels available on the
`scientific-python-nightly-wheels Anaconda Cloud organization
<https://anaconda.org/scientific-python-nightly-wheels>`_.
These wheels can be installed with ``pip`` by specifying
scientific-python-nightly-wheels as the package index to query:

.. code-block:: sh
scientific-python-nightly-wheels as the package index to query::

python -m pip install \
--upgrade \
Expand Down Expand Up @@ -143,8 +135,7 @@ Aspects of some behavioral defaults of the library can be configured via:
environment_variables_faq.rst

Default plotting appearance and behavior can be configured via the
:ref:`rcParams file <customizing-with-matplotlibrc-files>`

:ref:`rcParams file <customizing-with-matplotlibrc-files>`.

Dependencies
============
Expand Down Expand Up @@ -266,13 +257,17 @@ at the Terminal.app command line::

python3 -c 'import matplotlib; print(matplotlib.__version__, matplotlib.__file__)'

You should see something like ::
You should see something like

.. code-block:: none

3.10.0 /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/__init__.py

where ``3.10.0`` is the Matplotlib version you just installed, and the path
following depends on whether you are using Python.org Python, Homebrew or
Macports. If you see another version, or you get an error like ::
Macports. If you see another version, or you get an error like

.. code-block:: none

Traceback (most recent call last):
File "<string>", line 1, in <module>
Expand Down
46 changes: 22 additions & 24 deletions doc/install/troubleshooting_faq.inc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,23 @@ Obtaining Matplotlib version
----------------------------

To find out your Matplotlib version number, import it and print the
``__version__`` attribute::

>>> import matplotlib
>>> matplotlib.__version__
'0.98.0'
``__version__`` attribute:

>>> import matplotlib
>>> matplotlib.__version__
'0.98.0'

.. _locating-matplotlib-install:

:file:`matplotlib` install location
-----------------------------------

You can find what directory Matplotlib is installed in by importing it
and printing the ``__file__`` attribute::

>>> import matplotlib
>>> matplotlib.__file__
'/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/__init__.pyc'
and printing the ``__file__`` attribute:

>>> import matplotlib
>>> matplotlib.__file__
'/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/__init__.pyc'

.. _locating-matplotlib-config-dir:

Expand All @@ -39,32 +37,32 @@ and printing the ``__file__`` attribute::
Each user has a Matplotlib configuration directory which may contain a
:ref:`matplotlibrc <customizing-with-matplotlibrc-files>` file. To
locate your :file:`matplotlib/` configuration directory, use
:func:`matplotlib.get_configdir`::
:func:`matplotlib.get_configdir`:

>>> import matplotlib as mpl
>>> mpl.get_configdir()
'/home/darren/.config/matplotlib'
>>> import matplotlib as mpl
>>> mpl.get_configdir()
'/home/darren/.config/matplotlib'

On Unix-like systems, this directory is generally located in your
:envvar:`HOME` directory under the :file:`.config/` directory.

In addition, users have a cache directory. On Unix-like systems, this is
separate from the configuration directory by default. To locate your
:file:`.cache/` directory, use :func:`matplotlib.get_cachedir`::
:file:`.cache/` directory, use :func:`matplotlib.get_cachedir`:

>>> import matplotlib as mpl
>>> mpl.get_cachedir()
'/home/darren/.cache/matplotlib'
>>> import matplotlib as mpl
>>> mpl.get_cachedir()
'/home/darren/.cache/matplotlib'

On Windows, both the config directory and the cache directory are
the same and are in your :file:`Documents and Settings` or :file:`Users`
directory by default::
directory by default:

>>> import matplotlib as mpl
>>> mpl.get_configdir()
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
>>> mpl.get_cachedir()
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
>>> import matplotlib as mpl
>>> mpl.get_configdir()
'C:\\Documents and Settings\\jdhunter\\.matplotlib'
>>> mpl.get_cachedir()
'C:\\Documents and Settings\\jdhunter\\.matplotlib'

If you would like to use a different configuration directory, you can
do so by specifying the location in your :envvar:`MPLCONFIGDIR`
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy