Installing matplotlib on python3

Jussi Piitulainen jussi.piitulainen at helsinki.fi
Thu Jul 27 07:48:06 EDT 2017


FS writes:

> I just installed matplotlib on debian and I tried to import it on
> python3. It cannot be found however it can be found on python 2.x. No
> surprise:
>   A 'find -name matplotliib' reveals:
> /usr/share/matplotlib
> /usr/lib/python2.7/dist-packages/matplotlib
>
> I am not sure how the apt-get elected to place matplotlib in the
> python2.7 directory but I want to "properly" install it so it can
> import under python3.
>
>>There are probably commands from python3 to point its import to the
>> 2.7 directory, but I expect that is just a workaround and I am
>> uneasy about whether I have somehow installed a 2.7 compatible
>> version only of matplotlib.
>>Possibly there is some recommended way to re-install matplotlib for
>>python3 sending it to the appropriate directories.
>
> Any advice here?

You may find it's a different package, one named python3-* instead of
python-*:

$ apt-cache search matplotlib
idl - Interactive Data Language IDL
python-matplotlib - Python based plotting system in a style similar to Matlab
python-matplotlib-data - Python based plotting system (data package)
python-matplotlib-dbg - Python based plotting system (debug extension)
python-matplotlib-doc - Python based plotting system (documentation package)
python-mpltoolkits.basemap - matplotlib toolkit to plot on map projections
python-mpltoolkits.basemap-data - matplotlib toolkit to plot on map projections (data package)
python-mpltoolkits.basemap-doc - matplotlib toolkit to plot on map projections (documentation)
python-mpmath - library for arbitrary-precision floating-point arithmetic
python-mpmath-doc - library for arbitrary-precision floating-point arithmetic - Documentation
python-scitools - Python library for scientific computing
python-wxmpl - Painless matplotlib embedding in wxPython
python3-matplotlib - Python based plotting system in a style similar to Matlab (Python 3)
python3-matplotlib-dbg - Python based plotting system (debug extension, Python 3)
python3-mpmath - library for arbitrary-precision floating-point arithmetic (Python3)
$



More information about the Python-list mailing list