Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matplotlib Version

Tags:

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

$ python Python 2.7.6 (default, Jan 30 2014, 20:19:23)  [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> matplotlib.__version__ '1.1.1' 

This is a very outdated version and noone of my programs run with it. I used pip uninstall matplotlib and redid it with pip install 'the url for 1.3.1' and it still reads version 1.1.1. Is there a way I can manually delete all python libraries, even python itself, and restart from scratch? Or is this an obvious fix for this?

EDIT: I'm running Mac OS X version 10.9. I just reinstalled python 2.7 with scipy, numpy, and matplotlib through macports. Is there a very basic way to see where, when I import matplotlib from the python environment, it is calling it from? Like which in the terminal? I began using homebrew but switched to macports for more control. Can that be a problem? Do I need to completely remove homebrew?

I did get this message at first: Warning: Error parsing file /Applications/MacPorts/Python 2.7/Python Launcher.app/Contents/MacOS/Python Launcher: Error opening or reading file but after running $ sudo port -f deactivate python27 followed by sudo port activate python27 I no longer have that warning, but I wanted to include this detail for completeness.

EDIT 2: Could some things be installing to opt/local/bin when they need to be installed to usr/local/bin?

EDIT 3: To shed some light on this, print scipy.__version__ reads 0.11.0 which is several outdated, print numpy.__version__ reads 1.6.2 which is also outdated. However I attempt to install says the installation was successful, which I don't doubt. I suspect it's not linked up together in a correct way. Is there a way delete everything that is connected to python at all and restart?

FINAL EDIT: I think the easiest way to handle this is to run which python and see what options you have to run python. Because I used homebrew and macports at this time (not recommended) I had four options- a macports install, a package install from python.org, a homebrew install, and the standard 2.6 from Apple. Iterate through these and find which one your installer (pip or easy_install) is placing your frameworks and run that python when you need certain dependencies. The best way is use only one package manager and run virtual environments if you need different dependencies, but we're all learning as we go.

like image 430
Jared Avatar asked Jan 31 '14 06:01

Jared


People also ask

How do I find my matplotlib version?

Once you've successfully installed matplotlib, you can use the following command to display the matplotlib version in your environment: pip show matplotlib Name: matplotlib Version: 3.1.

Which Python version has matplotlib?

Dependencies. Matplotlib requires the following dependencies: Python (>= 3.6) NumPy (>= 1.15)

Does Python 3.8 support matplotlib?

matplotlib has released the suitable version for python 3.8.

Does Python 3.7 have matplotlib?

Matplotlib is a python library that allows you to represent your data visually. It's particularly useful for data science and machine learning developers. Matplotlib is the most visualization package for Python.


2 Answers

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__)) 
like image 107
Akash Kandpal Avatar answered Oct 11 '22 04:10

Akash Kandpal


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.

like image 23
phyrox Avatar answered Oct 11 '22 03:10

phyrox