If you are interested in contributing to Matplotlib development,running the latest source code, or just like to build everythingyourself, it is not difficult to build Matplotlib from source. Grabthe latest tar.gz release file from the PyPI files page, or if you want todevelop Matplotlib or just need the latest bugfixed version, grab thelatest git version, and see Install from source.
The standard environment variables
CC , CXX , PKG_CONFIG are respected.This means you can set them if your toolchain is prefixed. This may be used forcross compiling.
Once you have satisfied the requirements detailed below (mainlyPython, NumPy, libpng and FreeType), you can build Matplotlib.
We provide a setup.cfg file which you can use to customize the buildprocess. For example, which default backend to use, whether some of theoptional libraries that Matplotlib ships with are installed, and so on. Thisfile will be particularly useful to those packaging Matplotlib.
The dateutil module provides powerful extensions to the datetime module available in the Python standard library. Download ActivePython Subscribe to package updates. Su (switch to virtual environment) yum install python-dateutil Using su and then switching to the virtual environment will give root access and install to the virtual python directory. Using sudo will install libraries to the default directory, not the virtual environments site-packages. Nullsoft Scriptable Install System (6) Database Environment Database Environment. Database API (1,675) ADO.NET (84). 20752 programs for 'python-dateutil' Sort By: Relevance. Relevance Most Popular Last Updated. Now, this version of the game is also available for Windows and all devices where Python with Tkinter graphical environment is.
If you have installed prerequisites to nonstandard places and need toinform Matplotlib where they are, edit
setupext.py and add the basedirs to the basedir dictionary entry for your sys.platform ;e.g., if the header of some required library is in/some/path/include/someheader.h , put /some/path in thebasedir list for your platform.
Matplotlib requires the following dependencies:
Optionally, you can also install a number of packages to enable better userinterface toolkits. See What is a backend? for more details on theoptional Matplotlib backends and the capabilities they provide.
For better support of animation output format and image file formats, LaTeX,etc., you can install the following:
Note
Matplotlib depends on non-Python libraries.
On Linux and OSX, pkg-config can be used to find required non-Pythonlibraries and thus make the install go more smoothly if the libraries andheaders are not in the expected locations.
If not using pkg-config (in particular on Windows), you may need to set theinclude path (to the FreeType, libpng, and zlib headers) and link path (tothe FreeType, libpng, and zlib libraries) explicitly, if they are not instandard locations. This can be done using standard environment variables-- on Linux and OSX:
and on Windows:
where
... means 'also give, in the same format, the directoriescontaining png.h and zlib.h for the include path, and forlibpng.so /png.lib and libz.so /z.lib for the link path.'
Note
The following libraries are shipped with Matplotlib:
It is easiest to use your system package manager to install the dependencies.
![]()
If you are on Debian/Ubuntu, you can get all the dependenciesrequired to build Matplotlib with:
If you are on Fedora, you can get all the dependencies required to buildMatplotlib with:
If you are on RedHat, you can get all the dependencies required to buildMatplotlib by first installing
yum-builddep and then running:
These commands do not build Matplotlib, but instead get and install thebuild dependencies, which will make building from source easier.
The build situation on macOS is complicated by the various places onecan get the libpng and FreeType requirements (MacPorts, Fink,/usr/X11R6), the different architectures (e.g., x86, ppc, universal), andthe different macOS versions (e.g., 10.4 and 10.5). We recommend that you buildthe way we do for the macOS release: get the source from the tarball or thegit repository and install the required dependencies through a third-partypackage manager. Two widely used package managers are Homebrew, and MacPorts.The following example illustrates how to install libpng and FreeType using
brew :
If you are using MacPorts, execute the following instead:
After installing the above requirements, install Matplotlib from source byexecuting:
Note that your environment is somewhat important. Some conda users havefound that, to run the tests, their PYTHONPATH must include/path/to/anaconda/.../site-packages and their DYLD_FALLBACK_LIBRARY_PATHmust include /path/to/anaconda/lib.
The Python shipped from https://www.python.org is compiled with Visual Studio2015 for 3.5+. Python extensions should be compiled with the samecompiler, see e.g.https://packaging.python.org/guides/packaging-binary-extensions/#setting-up-a-build-environment-on-windowsfor how to set up a build environment.
Since there is no canonical Windows package manager, the methods for buildingFreeType, zlib, and libpng from source code are documented as a build scriptat matplotlib-winbuild.
There are a few possibilities to build Matplotlib on Windows:
Install Python Dateutil Windows Movie Theater
This is a wheel build, but we use conda packages to get all the requirements.The binary requirements (png, FreeType,...) are statically linked and thereforenot needed during the wheel install.
Set up the conda environment. Note, if you want a qt backend, add
pyqt tothe list of conda packages.
For building, call the script
build_alllocal.cmd in the root folder of therepository:
The conda packaging scripts for Matplotlib are available athttps://github.com/conda-forge/matplotlib-feedstock.
Stable Releases
Pre-releasesPython Setuptools
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2020
Categories |