Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matplotlib 1.4.2 fails to build in Python 3 (TypeError: unorderable types: str() < int()) #3889

Closed
certik opened this issue Dec 4, 2014 · 30 comments

Comments

@certik
Copy link

certik commented Dec 4, 2014

As part of Hashdist:

[matplotlib] Building matplotlib/l6hpd5xi44vw, follow log with:
[matplotlib]   tail -f /local/certik/tmp/matplotlib-l6hpd5xi44vw-1/build.log
[matplotlib] running [u'/bin/bash', '_hashdist/build.sh']
[matplotlib] environment:
[matplotlib]   {'ARTIFACT': u'/local/certik/bld/matplotlib/l6hpd5xi44vw',
[matplotlib]    'BASH': u'/bin/bash',
[matplotlib]    'BUILD': u'/local/certik/tmp/matplotlib-l6hpd5xi44vw-1',
[matplotlib]    u'BZIP2_DIR': u'/local/certik/bld/bzip2/yhn7t7sdxdfd',
[matplotlib]    u'BZIP2_ID': u'bzip2/yhn7t7sdxdfdkhyie6hg36hqvgccj7rj',
[matplotlib]    u'FREETYPE_DIR': u'/local/certik/bld/freetype/3j5vs5xri633',
[matplotlib]    u'FREETYPE_ID': u'freetype/3j5vs5xri6335xcnnxh7kt3iudaos7lp',
[matplotlib]    'HASHDIST_CPU_COUNT': '1',
[matplotlib]    'HDIST_CONFIG': '{"gc_roots":"/local/certik/gcroots","build_stores":[{"dir":"/local/certik/bld"}],"source_caches":[{"dir":"/local/certik/src"}],"cache":"/local/certik/cache","build_temp":"/local/certik/tmp"}',
[matplotlib]    'HDIST_IMPORT': u'bzip2/yhn7t7sdxdfdkhyie6hg36hqvgccj7rj freetype/3j5vs5xri6335xcnnxh7kt3iudaos7lp numpy/o7mh7o3cbu5sk2wukmtmo7qeebkdb6sz patchelf/k3rloj265ogtl4dmmmbmyt34dnffryka pkg-config/nnzbjosob2benze3u2c4vhd2swgkevnq png/q24b4y6ojqdwk2nwnblutd4qrjhmlmev python/m327azitptlvocjp2othxwmlsqcmxu3i setuptools/cl5h5p575pm7wzsnkqxnxgbiql45rrkl zlib/3el5ccejre7bcjqgld5gp6iym4ccd5oe',
[matplotlib]    'HDIST_IMPORT_PATHS': u'/local/certik/bld/bzip2/yhn7t7sdxdfd:/local/certik/bld/freetype/3j5vs5xri633:/local/certik/bld/numpy/o7mh7o3cbu5s:/local/certik/bld/patchelf/k3rloj265ogt:/local/certik/bld/pkg-config/nnzbjosob2be:/local/certik/bld/png/q24b4y6ojqdw:/local/certik/bld/python/m327azitptlv:/local/certik/bld/setuptools/cl5h5p575pm7:/local/certik/bld/zlib/3el5ccejre7b',
[matplotlib]    'HDIST_VIRTUALS': '',
[matplotlib]    u'NUMPY_DIR': u'/local/certik/bld/numpy/o7mh7o3cbu5s',
[matplotlib]    u'NUMPY_ID': u'numpy/o7mh7o3cbu5sk2wukmtmo7qeebkdb6sz',
[matplotlib]    'PATCHELF': u'/local/certik/bld/patchelf/k3rloj265ogt/bin/patchelf',
[matplotlib]    u'PATCHELF_DIR': u'/local/certik/bld/patchelf/k3rloj265ogt',
[matplotlib]    u'PATCHELF_ID': u'patchelf/k3rloj265ogtl4dmmmbmyt34dnffryka',
[matplotlib]    'PATH': u'/local/certik/bld/python/m327azitptlv/bin:/local/certik/bld/pkg-config/nnzbjosob2be/bin:/local/certik/bld/freetype/3j5vs5xri633/bin:/usr/bin:/bin',
[matplotlib]    u'PKG_CONFIG_DIR': u'/local/certik/bld/pkg-config/nnzbjosob2be',
[matplotlib]    'PKG_CONFIG_EXECUTABLE': u'/local/certik/bld/pkg-config/nnzbjosob2be/bin/pkg-config',
[matplotlib]    u'PKG_CONFIG_ID': u'pkg-config/nnzbjosob2benze3u2c4vhd2swgkevnq',
[matplotlib]    'PKG_CONFIG_PATH': u'/local/certik/bld/python/m327azitptlv/lib/pkgconfig:/local/certik/bld/png/q24b4y6ojqdw/lib/pkgconfig:/local/certik/bld/freetype/3j5vs5xri633/lib/pkgconfig',
[matplotlib]    u'PNG_DIR': u'/local/certik/bld/png/q24b4y6ojqdw',
[matplotlib]    u'PNG_ID': u'png/q24b4y6ojqdwk2nwnblutd4qrjhmlmev',
[matplotlib]    'PWD': u'/local/certik/tmp/matplotlib-l6hpd5xi44vw-1',
[matplotlib]    'PYTHON': u'/local/certik/bld/python/m327azitptlv/bin/python',
[matplotlib]    'PYTHONDONTWRITEBYTECODE': u'yes',
[matplotlib]    'PYTHONPATH': u'/local/certik/bld/setuptools/cl5h5p575pm7/lib/python3.4/site-packages:/local/certik/bld/numpy/o7mh7o3cbu5s/lib/python3.4/site-packages',
[matplotlib]    u'PYTHON_DIR': u'/local/certik/bld/python/m327azitptlv',
[matplotlib]    u'PYTHON_ID': u'python/m327azitptlvocjp2othxwmlsqcmxu3i',
[matplotlib]    u'SETUPTOOLS_DIR': u'/local/certik/bld/setuptools/cl5h5p575pm7',
[matplotlib]    u'SETUPTOOLS_ID': u'setuptools/cl5h5p575pm7wzsnkqxnxgbiql45rrkl',
[matplotlib]    u'ZLIB_DIR': u'/local/certik/bld/zlib/3el5ccejre7b',
[matplotlib]    u'ZLIB_ID': u'zlib/3el5ccejre7bcjqgld5gp6iym4ccd5oe'}
[matplotlib] Traceback (most recent call last):
[matplotlib]   File "<string>", line 1, in <module>
[matplotlib]   File "<string>", line 155, in <module>
[matplotlib]   File "/local/certik/tmp/matplotlib-l6hpd5xi44vw-1/setupext.py", line 1031, in check
[matplotlib]     min_version='1.2', version=version)
[matplotlib]   File "/local/certik/tmp/matplotlib-l6hpd5xi44vw-1/setupext.py", line 446, in _check_for_pkg_config
[matplotlib]     if (not is_min_version(version, min_version)):
[matplotlib]   File "/local/certik/tmp/matplotlib-l6hpd5xi44vw-1/setupext.py", line 174, in is_min_version
[matplotlib]     return found_version >= expected_version
[matplotlib]   File "/local/certik/bld/python/m327azitptlv/lib/python3.4/distutils/version.py", line 76, in __ge__
[matplotlib]     c = self._cmp(other)
[matplotlib]   File "/local/certik/bld/python/m327azitptlv/lib/python3.4/distutils/version.py", line 343, in _cmp
[matplotlib]     if self.version < other.version:
[matplotlib] TypeError: unorderable types: str() < int()
[matplotlib] ============================================================================
[matplotlib] Edit setup.cfg to change the build options
[matplotlib] 
[matplotlib] BUILDING MATPLOTLIB
[matplotlib]             matplotlib: yes [1.4.2]
[matplotlib]                 python: yes [3.4.2 (default, Dec  4 2014, 10:45:52)  [GCC
[matplotlib]                         4.4.7 20120313 (Red Hat 4.4.7-11)]]
[matplotlib]               platform: yes [linux]
[matplotlib] 
[matplotlib] REQUIRED DEPENDENCIES AND EXTENSIONS
[matplotlib]                  numpy: yes [version 1.8.2]
[matplotlib]                    six: yes [six was not found.]
[matplotlib]               dateutil: yes [dateutil was not found. It is required for date
[matplotlib]                         axis support. pip/easy_install may attempt to
[matplotlib]                         install it after matplotlib.]
[matplotlib]                   pytz: yes [pytz was not found. pip will attempt to install
[matplotlib]                         it after matplotlib.]
[matplotlib]                tornado: yes [tornado was not found. It is required for the
[matplotlib]                         WebAgg backend. pip/easy_install may attempt to
[matplotlib]                         install it after matplotlib.]
[matplotlib]              pyparsing: yes [pyparsing was not found. It is required for
[matplotlib]                         mathtext support. pip/easy_install may attempt to
[matplotlib]                         install it after matplotlib.]
[matplotlib]                  pycxx: yes [Official versions of PyCXX are not compatible
[matplotlib]                         with matplotlib on Python 3.x, since they lack
[matplotlib]                         support for the buffer object.  Using local copy]
[matplotlib]                 libagg: yes [pkg-config information for 'libagg' could not
[matplotlib]                         be found. Using local copy.]
[matplotlib]               freetype: yes [version 2.4.11]
[matplotlib|ERROR] Command '[u'/bin/bash', '_hashdist/build.sh']' returned non-zero exit status 1
[matplotlib|ERROR] command failed (code=1); raising

The issues #2087 and #3732 seem related.

It works in Python 2.7. The dependencies are exactly the same for 2.7 and 3.4. Here is the build script:

$ hit show python3.4.linux.yaml script matplotlib
set -e
export HDIST_IN_BUILD=yes
export CPPFLAGS="-I${BZIP2_DIR}/include -I${FREETYPE_DIR}/include -I${NUMPY_DIR}/include -I${PATCHELF_DIR}/include -I${PKG_CONFIG_DIR}/include -I${PNG_DIR}/include -I${PYTHON_DIR}/include -I${SETUPTOOLS_DIR}/include -I${ZLIB_DIR}/include"
export LDFLAGS="-L${BZIP2_DIR}/lib -Wl,-rpath=${BZIP2_DIR}/lib -L${FREETYPE_DIR}/lib -Wl,-rpath=${FREETYPE_DIR}/lib -L${NUMPY_DIR}/lib -Wl,-rpath=${NUMPY_DIR}/lib -L${PATCHELF_DIR}/lib -Wl,-rpath=${PATCHELF_DIR}/lib -L${PKG_CONFIG_DIR}/lib -Wl,-rpath=${PKG_CONFIG_DIR}/lib -L${PNG_DIR}/lib -Wl,-rpath=${PNG_DIR}/lib -L${PYTHON_DIR}/lib -Wl,-rpath=${PYTHON_DIR}/lib -L${SETUPTOOLS_DIR}/lib -Wl,-rpath=${SETUPTOOLS_DIR}/lib -L${ZLIB_DIR}/lib -Wl,-rpath=${ZLIB_DIR}/lib"

export PYTHONPATH=${ARTIFACT}/lib/python/site-packages:$PYTHONPATH
mkdir -p ${ARTIFACT}/lib/python/site-packages
${PYTHON} -c 'import setuptools; __file__="setup.py"; exec(open(__file__).read())' \
   install \
   --prefix=. --root=${ARTIFACT} \
   --single-version-externally-managed

And I used the 1.4.2 tarball: https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.4.2/matplotlib-1.4.2.tar.gz

And I use linux (RHEL6), though we build all the dependencies ourselves.

@tacaswell
Copy link
Member

Do you have libpng installed?

Something funny is coming out of status, output = getstatusoutput("libpng-config --version") (output gets assigned to version which is passed to the offending function). It works on python2 because strings and ints can be compared (via id which is not super useful), but they are not comparable in 3.

@certik
Copy link
Author

certik commented Dec 4, 2014

I do, this is what I get:

$ python3.4.linux/bin/libpng-config --version
1.6.6

@certik
Copy link
Author

certik commented Dec 4, 2014

But during the build it returns b'1.6.6', so that must be it.

@tacaswell
Copy link
Member

I wonder why this does not blow up on travis...

This is yet more issues with unicode vs bytes.

@certik
Copy link
Author

certik commented Dec 4, 2014

I think I found it. We install our own libpng package, but for some reason libpng-config during the build is executed from /usr/bin/libpng-config and that one returns things like:

[matplotlib] b'"/local/certik/bld/png/q24b4y6ojqdw"'
[matplotlib] b'1.6.6'
[matplotlib] -lpng12
[matplotlib] b'"/local/certik/bld/png/q24b4y6ojqdw"/lib'

So that's complete garbage. It's probably related to the fact that we use pkgconf: http://rabbit.dereferenced.org/~nenolod/distfiles/pkgconf-0.9.6.tar.bz2, instead of the usual pkg-config.

In any case, let's see if I can fix this.

@certik
Copy link
Author

certik commented Dec 4, 2014

@tacaswell I found it!! This patch fixes it: hashdist/hashstack@0aa2605, what happened was that we were putting our own wrapper on top of pkgconf so that we can insert Hashdist variables into it (things like fixing rpath issues), so that matplotlib and other packages can pick it up properly. But that wrapper didn't work properly in Python 3, which was then messing up Matplotlib.

So this issue is fixed, it's unrelated to matplotlib. But I still think the error message might be more descriptive --- maybe you can check that the answer makes sense?

@certik certik closed this as completed Dec 4, 2014
@certik
Copy link
Author

certik commented Dec 4, 2014

Thanks for your help, this would take me a lot longer to figure out without it.

@tacaswell
Copy link
Member

The explanation makes sense.

I would argue that the real problem is in distutils. We are using distutils.version.LooseVersion to make the versions comparable and I think we should be able to assume that whatever it gives back will be comparable.

@certik
Copy link
Author

certik commented Dec 4, 2014

Ah I see. Yes, indeed.

Quite frankly, I just use cmake for my projects and I handle Python installation from cmake. Then I don't have any of these issues.

@tacaswell
Copy link
Member

Yes, but then you have all manner of cmake issues 😉

Your projects won't (might not?) play nice with other people's setup.py/pip/requirements.txt/venvs. I had an absolute bear of a time trying to get peoples cmake built python packages (ITK) to play nice with virtual environments.

Of course the solution to that is hashdist/conda (which at least in the case of conda were created to deal with this pain).

@certik
Copy link
Author

certik commented Dec 4, 2014

Exactly, the same for Hashdist.

I think it is possible to make cmake play nice with pip, e.g. here we test that at least pip install . works with cmake: https://github.com/sympy/csympy/blob/master/bin/test_travis.sh#L52. One just needs to test the various combinations. What I like about cmake is that you just have this Python "wrapper" (https://github.com/sympy/csympy/blob/master/setup.py) that can be fragile, but underneath is a robust system (cmake), to which you tell exactly where to find things and if it can't find it or something fails, you get a reasonable message.

@sontek
Copy link

sontek commented Apr 16, 2015

are we sure this is fixed? I'm getting this on 1.4.3:

        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.1 (default, Nov  3 2014, 14:38:10)  [GCC
                            4.9.1 20140930 (Red Hat 4.9.1-11)]]
                  platform: yes [linux]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.9.2]
                       six: yes [using six version 1.9.0]
                  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.3]
                     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.]

@tacaswell
Copy link
Member

Does the same happen with 1.4.3?

That very unhelpful error is saying that you do not have freetype-dev or
pkg-config installed (that is the version check it is failing on abs the
two most common reasons for the discovered version to come back as a
string).

Tom

On Thu, Apr 16, 2015, 17:51 John Anderson notifications@github.com wrote:

are we sure this is fixed? I'm getting this on 1.4.3:

    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.1 (default, Nov  3 2014, 14:38:10)  [GCC
                        4.9.1 20140930 (Red Hat 4.9.1-11)]]
              platform: yes [linux]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.9.2]
                   six: yes [using six version 1.9.0]
              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.3]
                 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.]


Reply to this email directly or view it on GitHub
#3889 (comment)
.

@sontek
Copy link

sontek commented Apr 16, 2015

@tacaswell It is it 1.4.3, here is more info:

pkg-config --version
0.28

freetype-config --version
17.2.11

sudo dnf info freetype-devel
Using metadata from Thu Apr 16 08:30:58 2015
Installed Packages
Name        : freetype-devel
Arch        : x86_64
Epoch       : 0
Version     : 2.5.3
Release     : 16.fc21
Size        : 2.5 M
Repo        : @System
Summary     : FreeType development libraries and header files
URL         : http://www.freetype.org
License     : (FTL or GPLv2+) and BSD and MIT and Public Domain and zlib with acknowledgement
Description : The freetype-devel package includes the static libraries and header files
            : for the FreeType font rendering engine.
            : 
            : Install freetype-devel if you want to develop programs which will use
            : FreeType.


sudo dnf info pkgconfig
Using metadata from Thu Apr 16 08:30:58 2015
Installed Packages
Name        : pkgconfig
Arch        : x86_64
Epoch       : 1
Version     : 0.28
Release     : 6.fc21
Size        : 105 k
Repo        : @System
Summary     : A tool for determining compilation options
URL         : http://pkgconfig.freedesktop.org
License     : GPLv2+
Description : The pkgconfig tool determines compilation options. For each required
            : library, it reads the configuration file and outputs the necessary
            : compiler and linker flags.

@sontek
Copy link

sontek commented Apr 16, 2015

hahaha, I found out why its failing...

    self.version: ['grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 2, 5, 3]
    other.version: [2, 3]

So I have GREP_OPTIONS in my bashrc and that is deprecated, and I guess the way you are executing the command its catching those warnings as well.

@sontek
Copy link

sontek commented Apr 16, 2015

Installation worked after I did:

unset GREP_OPTIONS

My grep looked like this before:

$ grep '192' foo.txt
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: foo.txt: No such file or directory

@tacaswell
Copy link
Member

That is new and interesting. I don't think there is much we can do about
that except make the exception more informative.

Sorry for the version confusion, I read 1.4.2 not what you actually wrote.

On Thu, Apr 16, 2015, 18:13 John Anderson notifications@github.com wrote:

hahaha, I found out why its failing...

self.version: ['grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 'grep', ': ', 'warning', ': GREP_OPTIONS ', 'is', ' ', 'deprecated', '; ', 'please', ' ', 'use', ' ', 'an', ' ', 'alias', ' ', 'or', ' ', 'script', '\n', 2, 5, 3]
other.version: [2, 3]

So I have GREP_OPTIONS in my bashrc and that is deprecated, and I guess
the way you are executing the command its catching those warnings as well.


Reply to this email directly or view it on GitHub
#3889 (comment)
.

@sontek
Copy link

sontek commented Apr 16, 2015

@tacaswell Could you send stderr to dev null like:

grep 2>/dev/null

and only grab stdout?

@ben-albrecht
Copy link

Having same issue - Python3.5.0a3 (dev) / Mac OSX
No GREP_OPTIONS are set.

Collecting matplotlib
  Using cached matplotlib-1.4.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/private/var/folders/40/djf_m7514x7_7kyshcxvd1t40000gn/T/pip-build-1id299kl/matplotlib/setup.py", line 155, in <module>
        result = package.check()
      File "/private/var/folders/40/djf_m7514x7_7kyshcxvd1t40000gn/T/pip-build-1id299kl/matplotlib/setupext.py", line 961, in check
        min_version='2.3', version=version)
      File "/private/var/folders/40/djf_m7514x7_7kyshcxvd1t40000gn/T/pip-build-1id299kl/matplotlib/setupext.py", line 445, in _check_for_pkg_config
        if (not is_min_version(version, min_version)):
      File "/private/var/folders/40/djf_m7514x7_7kyshcxvd1t40000gn/T/pip-build-1id299kl/matplotlib/setupext.py", line 173, in is_min_version
        return found_version >= expected_version
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/version.py", line 70, in __ge__
        c = self._cmp(other)
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/version.py", line 337, 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.5.0a3 (v3.5.0a3:82656e28b5e5, Mar 29 2015,
                            15:59:31)  [GCC 4.2.1 (Apple Inc. build 5666) (dot
                            3)]]
                  platform: yes [darwin]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.9.2]
                       six: yes [using six version 1.9.0]
                  dateutil: yes [dateutil was not found. It is required for date
                            axis support. pip/easy_install may attempt to
                            install it after matplotlib.]
                      pytz: yes [pytz was not found. pip will attempt to install
                            it after matplotlib.]
                   tornado: yes [tornado was not found. It is required for the
                            WebAgg backend. pip/easy_install may attempt to
                            install it after matplotlib.]
                 pyparsing: yes [pyparsing was not found. It is required for
                            mathtext support. pip/easy_install may attempt to
                            install it after matplotlib.]
                     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.]

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/40/djf_m7514x7_7kyshcxvd1t40000gn/T/pip-build-1id299kl/matplotlib

@jenshnielsen
Copy link
Member

@ben-albrecht Can you make sure that you have freetype installed. Alternatively try the master branch we recently fixed a bug in the version comparison only happening when freetype is not found

@ben-albrecht
Copy link

@jenshnielsen Thanks for the suggestion. The latest version from master branch gives a more helpful error message

* The following required packages can not be built:                                                                                                                              * freetype, png 

I Installed Freetype via homebrew and pip installed matplotlib from via pip install git+https://github.com/matplotlib/matplotlib - everything works fine now.

@sandrotosi
Copy link
Contributor

I'm seeing a similar failure in debian unstable:

python3.5 ./setup.py install_lib \
        -d /build/matplotlib-1.5.2/debian/python3-matplotlib/usr/lib/python3/dist-packages/ --no-compile
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [1.5.2]
                python: yes [3.5.2+ (default, Aug 30 2016, 19:08:42)  [GCC
                        6.2.0 20160822]]
              platform: yes [linux]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.11.1rc1]
              dateutil: yes [using dateutil version 2.4.2]
                  pytz: yes [using pytz version 2015.7]
                cycler: yes [using cycler version 0.10.0]
               tornado: yes [using tornado version 4.4.1]
             pyparsing: yes [using pyparsing version 2.1.8]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
Traceback (most recent call last):
  File "./setup.py", line 167, in <module>
    result = package.check()
  File "/build/matplotlib-1.5.2/setupext.py", line 920, in check
    min_version='2.3', version=version)
  File "/build/matplotlib-1.5.2/setupext.py", line 463, in _check_for_pkg_config
    if (not is_min_version(version, min_version)):
  File "/build/matplotlib-1.5.2/setupext.py", line 183, in is_min_version
    return found_version >= expected_version
  File "/usr/lib/python3.5/distutils/version.py", line 70, in __ge__
    c = self._cmp(other)
  File "/usr/lib/python3.5/distutils/version.py", line 337, in _cmp
    if self.version < other.version:
TypeError: unorderable types: str() < int()

and that line seems to refer indeed to freetype, but running -ftversion i get:

root@oracle:/build/matplotlib-1.5.2# freetype-config --ftversion
2.6.3

any idea what might be going on?

@tacaswell
Copy link
Member

do you have pkgconfig installed?

@sandrotosi
Copy link
Contributor

yes pkg-config is installed (at version 0.29-4 if that's useful to know)

@tacaswell
Copy link
Member

@sandrotosi can you open a new issue for this?

@sandrotosi
Copy link
Contributor

i rebuilt the packages just to be sure (i had a suspect, reading this bug, it might have been due to a library (fakeroot) that was generating symbols errors and thus messing up with the versions gathering) and it was a transient error, which is now over - sorry for the noise

@archenroot
Copy link

@sandrotosi I am facing same issue with python 3.4.3 and pip3 install matplotlib==1.4.3:

pip3 install matplotlib==1.4.3
Collecting matplotlib==1.4.3
  Using cached matplotlib-1.4.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-k8a4gfrf/matplotlib/setup.py", line 155, in <module>
        result = package.check()
      File "/tmp/pip-build-k8a4gfrf/matplotlib/setupext.py", line 961, in check
        min_version='2.3', version=version)
      File "/tmp/pip-build-k8a4gfrf/matplotlib/setupext.py", line 445, in _check_for_pkg_config
        if (not is_min_version(version, min_version)):
      File "/tmp/pip-build-k8a4gfrf/matplotlib/setupext.py", line 173, in is_min_version
        return found_version >= expected_version
      File "/usr/local/lib/python3.4/distutils/version.py", line 76, in __ge__
        c = self._cmp(other)
      File "/usr/local/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.3 (default, Dec  5 2017, 11:03:28)  [GCC
                            4.4.7 20120313 (Red Hat 4.4.7-18)]]
                  platform: yes [linux]
    
    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.9.2]
                       six: yes [using six version 1.11.0]
                  dateutil: yes [using dateutil version 2.6.1]
                      pytz: yes [using pytz version 2015.2]
                   tornado: yes [tornado was not found. It is required for the
                            WebAgg backend. pip/easy_install may attempt to
                            install it after matplotlib.]
                 pyparsing: yes [using pyparsing version 2.2.0]
                     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.]
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-k8a4gfrf/matplotlib/

@archenroot
Copy link

Ok, guys as soon as on one system the error did not appear and on other did I compared libs and found issue, there were missing:

libpng
libpng-devel
freetype
freetype-devel

Is Python really that stupid or it is due to how matplotlib is managed? If I miss library I screem I am missing that library, so user can install it.... this is detective work...

@tacaswell
Copy link
Member

The error you are getting is in the logic where we are trying to tell you that there are missing libraries.

You are trying to build no longer supported versions of Matplotlib on an old version of python. I believe we have fixed all of these issues in the current versions of Matplotlib with up-to-date python.

@archenroot
Copy link

I know, this is some software we received from vendor to install in our environment, not much to do. Apps are developed and used without update for years...

When I am in Java and miss some library it tells me: you are missing this library FULL NAME of class, so...

But ok, I know this is old thread... thx for answer anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants