Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matplotlib installation issue python 3

I am trying to install metaplotlib on ubuntu 14.04 within pycharm and get the following error:

TypeError: unorderable types: str() < int()

ubuntu 14.04 64bits pycharm running python 3

The traceback is:

DEPRECATION: --no-install, --no-download, --build, and --no-clean are deprecated.  Downloading/unpacking matplotlib   Running setup.py (path:/tmp/pycharm-packaging7.tmp/matplotlib/setup.py) egg_info for package matplotlib
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pycharm-packaging7.tmp/matplotlib/setup.py", line 155, in <module>
        result = package.check()
      File "/tmp/pycharm-packaging7.tmp/matplotlib/setupext.py", line 961, in check
        min_version='2.3', version=version)
      File "/tmp/pycharm-packaging7.tmp/matplotlib/setupext.py", line 445, in _check_for_pkg_config
        if (not is_min_version(version, min_version)):
      File "/tmp/pycharm-packaging7.tmp/matplotlib/setupext.py", line 173, in is_min_version
        return found_version >= expected_version
      File "/usr/lib/python3.4/distutils/version.py", line 76, in __ge__
        c = self._cmp(other)
      File "/usr/lib/python3.4/distutils/version.py", line 343, in _cmp
        if self.version < other.version:
    TypeError: unorderable types: str() < int()
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [1.4.3]
                    python: yes [3.4.0 (default, Apr 11 2014, 13:05:11)  [GCC
                            4.8.2]]
                  platform: yes [linux]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.9.2]
                       six: yes [using six version 1.5.2]
                  dateutil: yes [using dateutil version 2.4.2]
                      pytz: yes [using pytz version 2015.2]
                   tornado: yes [using tornado version 4.1]
                 pyparsing: yes [using pyparsing version 2.0.1]
                     pycxx: yes [Official versions of PyCXX are not compatible
                            with matplotlib on Python 3.x, since they lack
                            support for the buffer object.  Using local copy]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pycharm-packaging7.tmp/matplotlib/setup.py", line 155, in <module>

    result = package.check()

  File "/tmp/pycharm-packaging7.tmp/matplotlib/setupext.py", line 961, in check

    min_version='2.3', version=version)

  File "/tmp/pycharm-packaging7.tmp/matplotlib/setupext.py", line 445, in _check_for_pkg_config

    if (not is_min_version(version, min_version)):

  File "/tmp/pycharm-packaging7.tmp/matplotlib/setupext.py", line 173, in is_min_version

    return found_version >= expected_version

  File "/usr/lib/python3.4/distutils/version.py", line 76, in __ge__

    c = self._cmp(other)

  File "/usr/lib/python3.4/distutils/version.py", line 343, in _cmp

    if self.version < other.version:

TypeError: unorderable types: str() < int()

============================================================================

Edit setup.cfg to change the build options

Can someone please advise? Thanks

like image 850
rearThing Avatar asked May 10 '15 21:05

rearThing


People also ask

Does matplotlib work with python3?

Matplotlib has supported python3 since version 1.2.

Does Python 3.9 support matplotlib?

BUILDING MATPLOTLIB matplotlib: yes [3.3. 2] python: yes [3.9.

Does Python 3.8 support matplotlib?

matplotlib has released the suitable version for python 3.8.

What version of Matplotlib do I need to install?

Since there are no wheels available, installing matplotlib 3.1.1 on python 3.8 requires to build it from source. This process may turn out to be a little cumbersome. So for anyone having problems with that, either Install matplotlib 3.1.1 on python 3.7

Why does Matplotlib installation through Pip fail on Python 3?

Matplotlib installation through pip fails on Python 3.8.0b3 due to a problem with Visual C++. I was able to successfully install matplotlib on Python 3.7.4 without the bug.

How to install Matplotlib in Anaconda?

To install matplotlib open the anaconda prompt. If the import will run then you are finished and you can start matplotlib. And if import statement will fail then see at the appropriate section below os. The commands will install the matplotlib in the current python enviourement.

Is there a binary wheel for Matplotlib 3 8?

Be assured that there will be binary wheels for python 3.8 for the next matplotlib release that comes after the release of python 3.8, which is matplotlib 3.2. Sorry, something went wrong. It seems people come here via search and are disappointed by not finding appropriate information on installing matplotlib 3.1.1 on python 3.8.


1 Answers

I was getting the same error and was able to solve it by installing libfreetype6-dev and libpng12-dev.

sudo apt-get install libfreetype6-dev libpng12-dev

Thanks to @koukouviou for pointing the upstream bug report, which considerably sped up the solution finding process.

like image 153
Stunts Avatar answered Oct 17 '22 04:10

Stunts