This is a series of Plotting tutorials using Matplotlib in Python. All the programs and examples will be available in this public folder! I am trying to upgrade matplotlib on my Mac (Sierra 10.13.1) I do sudo pip install -upgrade matplotlib, and get the following error, and my matplotlib version remains unchanged at 1.3.1. Sections Installing SciPy. Free download matplotlib matplotlib for Mac OS X. Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python. Download matplotlib for Mac 2.1.0 for Mac. Fast downloads of the latest free software!
There are many different ways to install matplotlib, and the best waydepends on what operating system you are using, what you already haveinstalled, and how you want to use it. To avoid wading through allthe details (and potential complications) on this page, there are severalconvenient options.
Installing pre-built packages¶
Most platforms : scientific Python distributions¶
The first option is to use one of the pre-packaged pythondistributions that already provide matplotlib built-in. TheContinuum.io Python distribution (Anaconda or miniconda) and the Enthoughtdistribution (Canopy)are both excellent choices that “just work” out of the box forWindows, OSX and common Linux platforms. Both of these distributionsinclude matplotlib and lots of other useful tools. Anotherexcellent alternative for Windows users is Python (x, y) .
Linux : using your package manager¶
If you are on Linux, you might prefer to use your package manager. matplotlibis packaged for almost every major Linux distribution.
- Debian / Ubuntu : sudoapt-getinstallpython-matplotlib
- Fedora / Redhat : sudoyuminstallpython-matplotlib
Matplotlib Install
Mac OSX : using pip¶
If you are on Mac OSX you can probably install matplotlib binaries using thestandard Python installation program pip.See Installing OSX binary wheels.
Windows¶
If you don’t already have Python installed, we recommend usingone of the scipy-stack compatible Python distributions such as Python(x,y),Enthought Canopy, or Continuum Anaconda, which have matplotlib andmany of its dependencies, plus other useful packages, preinstalled.
For standard Python installationsyou will also need to install compatible versions ofsetuptools,numpy,python-dateutil,pytz,pyparsing andsixin addition tomatplotlib.
In case Python is not installed for all users (not the default), theMicrosoft Visual C++ 2008 (64 bitor32 bitfor Python 2.6 to 3.2) or Microsoft Visual C++ 2010 (64 bitor32 bitfor Python 3.3 and 3.4) redistributable packages need to be installed.
Matplotlib depends on Pillowfor reading and saving JPEG, BMP, and TIFF image files.Matplotlib requires MiKTeX andGhostScript for rendering textwith LaTeX.FFmpeg, avconv,mencoder, orImageMagick are required for theanimation module.
The following backends should work out of the box: agg, tkagg, ps,pdf and svg.For other backends you may need to installpycairo,PyQt4,PyQt5,PySide,wxPython,PyGTK,Tornado,or GhostScript.
TkAgg is probably the best backend for interactive use from thestandard Python shell or IPython. It is enabled as the default backendfor the official binaries. GTK3 is not supported on Windows.
The Windows installers (*.exe) and wheels (*.whl) onthe download page do notcontain test data or example code.If you want to try the many demos that come in the matplotlib sourcedistribution, download the *.tar.gz file and look in theexamples subdirectory.To run the test suite, copy the libmatplotlibtests andlibmpl_toolkitstests directories from the source distribution tosys.prefixLibsite-packagesmatplotlib andsys.prefixLibsite-packagesmpl_toolkits respectively, and installnose,mock,Pillow, MiKTeX, GhostScript, ffmpeg, avconv, mencoder, ImageMagick, andInkscape.
Installing from source¶
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 download page, or if you wantto develop matplotlib or just need the latest bugfixed version, grabthe latest git version Source install from git.
Once you have satisfied the requirements detailed below (mainlypython, numpy, libpng and freetype), you can build matplotlib:
We provide a setup.cfgfile that goes with setup.py which you can use to customizethe build process. For example, which default backend to use, whethersome of the optional libraries that matplotlib ships with areinstalled, and so on. This file will be particularly useful to thosepackaging matplotlib.
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 to some required library is in/some/path/include/someheader.h, put /some/path in thebasedir list for your platform.
Build requirements¶
These are external packages which you will need to install beforeinstalling matplotlib. If you are building on OSX, seeBuilding on OSX. If you are building on Windows, seeBuilding on Windows. If you are installing dependencies with apackage manager on Linux, you may need to install the developmentpackages (look for a “-dev” postfix) in addition to the librariesthemselves.
Required Dependencies¶
- python 2.6, 2.7, 3.3 or 3.4
- Download python.
- numpy 1.6 (or later)
- array support for python (download numpy)
- dateutil 1.1 or later
- Provides extensions to python datetime handling. If using pip,easy_install or installing from source, the installer will attemptto download and install python_dateutil from PyPI. Note thatpython_dateutil also depends on six. pip and other packagemanagers should handle installing that secondary dependencyautomatically.
- pyparsing
- Required for matplotlib’s mathtext math rendering support. Ifusing pip, easy_install or installing from source, the installerwill attempt to download and install pyparsing from PyPI.
- six 1.4 or later
- Python 2/3 compatibility library. This is also a dependency ofdateutil.
- libpng 1.2 (or later)
- library for loading and saving PNG files (download). libpng requireszlib.
- pytz
- Used to manipulate time-zone aware datetimes.
Optional GUI framework¶
These are optional packages which you may want to install to usematplotlib with a user interface toolkit. SeeWhat is a backend? for more details on the optional matplotlibbackends and the capabilities they provide.
- tk 8.3 or later
- The TCL/Tk widgets library used by the TkAgg backend
- pyqt 4.0 or later
- The Qt4 widgets library python wrappers for the Qt4Agg backend
- pygtk 2.4 or later
- The python wrappers for the GTK widgets library for use with theGTK or GTKAgg backend
- wxpython 2.8 or later
- The python wrappers for the wx widgets library for use with theWX or WXAgg backend
Optional external programs¶
- ffmpeg/avconv or mencoder
- Required for the animation module to be save out put to movieformats.
- ImageMagick
- Required for the animation module to be able to save to animated gif.
Optional dependencies¶
- Pillow
- If Pillow is installed, matplotlib can read and write a largerselection of image file formats.
- freetype 2.3 or later
- library for reading true type font files.
Required libraries that ship with matplotlib¶
- agg 2.4
- The antigrain C++ rendering engine. matplotlib links against theagg template source statically, so it will not affect anything onyour system outside of matplotlib.
- PyCXX 6.2.4
- A library for writing Python extensions in C++.
- qhull 2012.1
- A library for computing convex hulls. Used for computing triangulationand meshes.
- ttconv
- truetype font utility
Building on Linux¶
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/RedHat, you can get all the dependencies requiredto build matplotlib by first installing yum-builddep and thenrunning:
This does not build matplotlib, but it does get the install thebuild dependencies, which will make building from source easier.
Building on OSX¶
The build situation on OSX is complicated by the various places onecan get the libpng and freetype requirements (darwinports, fink,/usr/X11R6) and the different architectures (e.g., x86, ppc, universal) andthe different OSX version (e.g., 10.4 and 10.5). We recommend that you buildthe way we do for the OSX release: get the source from the tarball or thegit repository and follow the instruction in README.osx.
Building on Windows¶
The Python shipped from http://www.python.org is compiled with Visual Studio2008 for versions before 3.3 and Visual Studio 2010 for 3.3 and later. Pythonextensions are recommended to be compiled with the same compiler. The .NETFramework 4.0 is required for MSBuild (you’ll likely have the requisiteFramework with Visual Studio). In addition to Visual Studio CMake is required for building libpng.
Since there is no canonical Windows package manager the build methods forfreetype, zlib, libpng, tcl, & tk source code are documented as a build scriptat matplotlib-winbuild.
Download Matplotlib Mac Python
转 Install Python, NumPy, SciPy, and matplotlib on Mac OS X
Pylab Download Mac
A bit ago a friend and I both had fresh Mac OS X Lion installs so I helped him set up his computers with a scientific Python setup and did mine at the same time. These instructions are for Lion but should work on Snow Leopard or Mountain Lion without much trouble. On Snow Leopard you won’t install Xcode via the App Store, you’ll have to download it from Apple. After I’d helped my friend I found this blog post describing a procedure pretty much the same as below. Update: If doing all the stuff below doesn’t seem like your cup of tea, it’s also possible to install Python, NumPy, SciPy, and matplotlib using double-click binary installers (resulting in a much less flexible installation), see this post to learn how. You will need Apple’s developer tools in order to compile Python and the other installs. On Lion you can install Xcode from the App Store, on Snow Leopard you’ll have to get an older Xcode from developer.apple.com. I use the Xcode editor because I like its syntax highlighting, code completion, and organizer. However, I use hardly any of its features and unless you’re an iOS or Mac developer you probably won’t either. If you prefer another editor it’s possible to get only the libraries and compilers that you need with the Command Line Tools for Xcode. (You’ll need a free Apple ID.) (See also http://www.kennethreitz.com/xcode-gcc-and-homebrew.html.) Homebrew is an excellent package manager for Mac OS X that can install a large number of packages. To install it simply launch a terminal and enter Homebrew installs things to /usr/local/ so you don’t need sudo permissions. To add Homebrew installed executables and Python scripts to your path you’ll want to add the following line to your .profile (or .bash_profile ) file:Normal executables go in /usr/local/bin/ and Python scripts installed by Homebrew go in/usr/local/share/python/ .See https://github.com/mxcl/homebrew/wiki/The-brew-command or type brew help or man brew for more info on Homebrew.Now that you’ve got Homebrew installing Python is simple: Homebrew will install a couple of packages required by Python and then Python itself. Don’t be surprised if this takes a couple minutes. Important: You should close your terminal and open a fresh one right now so that it has the updated PATH from the previous section. Otherwise you run the risk of executing the wrong scripts during the rest of these instructions. At this point you should be able to get a fresh terminal and type and see Homebrew is for installing system packages and tools; for managing Python add-ons we wantpip. Luckily easy_install, another Python package manager is installed by Homebrew and we can use it to install pip: Use pip to install NumPy: This should install NumPy 1.6.1 (as of Feb. 2012). We need gfortran to compile SciPy but it is not included with the other Xcode tools. Luckily, Homebrew can help us out again: When that’s done it’s a cinch to install SciPy: This should install SciPy 0.10. To install matplotlib we need to revisit Homebrew one more time: And the usual pip command: Mac users interested in Photoshop cs3 portable generally download: Adobe Photoshop CC 2014.2 The Adobe Photoshop family of products is the ultimate playground for bringing out. Adobe photoshop download cs3 free. The latest version of Adobe Version Cue CS3 is 3.1 on Mac Informer. It is a perfect match for the System Tools category. The app is developed by Adobe Systems Inc. And its user rating is 2.7 out of 5. Download adobe creative suite cs3 for free. System Tools downloads - Adobe Version Cue CS3 by Adobe Systems Inc. And many more programs are available for instant and free download. Adobe premiere cs3 free download - Adobe Premiere Pro CC, Adobe Premiere Elements, Adobe Premiere Pro trial, and many more programs. SiteGrinder Mac for Photoshop prior to CS3. Adobe cs3 master collection free download - Adobe Master Collection CS5.5, Adobe Illustrator CS6, SiteGrinder Mac for Photoshop prior to CS3, and many more programs. This should install matplotlib 1.2.0. If it doesn’t you can try installing from the matplotlib development repo: Congratulations! You should now have the basics of a scientific Python installation that’s easy to manage and upgrade using Homebrew and pip. Fire up Python and make sure things worked. The following should work in Python with no errors: Enjoy! |
本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。如发现有害或侵权内容,请点击这里 或 拨打24小时举报电话:4000070609 与我们联系。
来自: 复杂网络621 > 《python安装》
推一荐:发原创得奖金,“原创奖励计划”来了!|有奖征文:快来留下你与北京的故事吧!
How To Install Matplotlib Mac
0条评论
请遵守用户 评论公约
查看更多评论 Matplotlib Download Mac
- [转] 个人信用报告中的数字和“*”、“N”、“/”等符号究竟代表什么含义?评分卡模型中的IV和WOE详解Python 生成requirement 使用requirements.txt安装类库