Matplotlib Version

前端 未结 5 980
刺人心
刺人心 2021-01-03 22:21

Having my system prepped with homebrew and using pip install matplotlib after successful installation of numpy and scipy, I\'m getting a successful installation

相关标签:
5条回答
  • 2021-01-03 22:50

    The problem was with the $PATH variable. Instead of changing something in that variable, I uninstalled all packages in ./Library/Frameworks/. Either way would work. When I was getting that my current version was '1.1.1', that was the current version for the standard python installed on Mac, which is version 2.6, when I was updating with all of the current libraries for 2.7.

    NOTE: When uninstalling the frameworks, do not uninstall 2.6 however because the preinstalled mac build is used for a lot of other Mac programs, and I ended up having to reinstall my OS.

    0 讨论(0)
  • 2021-01-03 22:53

    Copy-Paste the following code in your terminal and press enter , it will show the version of matplotlib installed on your system ::

    python 
    import matplotlib
    print('matplotlib: {}'.format(matplotlib.__version__))
    
    0 讨论(0)
  • 2021-01-03 22:59

    If you install yolk, you can see with

    yolk -V matplotlib 
    

    that version 1.3.1 of matplotlib is available. But pip won't let you install it because it is managed externally. The solution is to do:

    pip install -Iv https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz 
    

    At first it didn't work for me though because of a problem with true type fonts. but I just had to google for the error message to find the solution on stackoverflow, which is to do the following before installing matplotlib:

    ln -s /usr/local/opt/freetype/include/freetype2 /usr/local/include/freetype 
    
    0 讨论(0)
  • 2021-01-03 23:01

    Using Matplotlib in OSX can give you problems. In this page, they say:

    The build situation on OSX is complicated by the various places one can get the libpng and freetype requirements (darwinports, fink, /usr/X11R6) and the different architectures (e.g., x86, ppc, universal) and the different OSX version (e.g., 10.4 and 10.5).

    In the official page of Matplotlib they recommend to use the mkpg installer:

    The mkpg installer will have a “zip” extension, and will have a name like matplotlib-1.2.0-py2.7-macosx10.5_mpkg.zip. The name of the installer depends on which versions of python, matplotlib, and OSX it was built for. [...] install to a directory like /Library/Python/2.7/site-packages/ (exact path depends on your python version).

    In the OSX-Notes Section you have more information about this installing.

    Edited:

    I haven't found any MPKG but you can use this DMG.

    0 讨论(0)
  • 2021-01-03 23:09

    I had this error as well.

    A simple change of ~/.profile or ~/.bash_profile of the path order fixed it. Before it was looking in /usr/bin first and not where things had been linked with homebrew.

    export PATH=/usr/local/bin:$PATH
    
    0 讨论(0)
提交回复
热议问题