Skip to content

matplotlib for Py3 #1131

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

Closed
jrkerns opened this issue Jan 23, 2015 · 7 comments
Closed

matplotlib for Py3 #1131

jrkerns opened this issue Jan 23, 2015 · 7 comments
Labels
Bug A bug Operations Operations or server issue

Comments

@jrkerns
Copy link

jrkerns commented Jan 23, 2015

matplotlib seems to be installed for the RTD python 2.x interpreter, but not for 3.x. Is this accurate? Can we get matplotlib for the python 3 interpreter? Thanks!

Py3 output: https://readthedocs.org/builds/pylinac/2140306/ (no matplotlib)
Py2 output: https://readthedocs.org/builds/pylinac/2140221/ (build chokes on py3 code, but has found matplotlib)

@ankostis
Copy link
Contributor

ankostis commented Feb 2, 2015

Related bugs: #896, #1056

@cdeil
Copy link

cdeil commented Jun 24, 2015

We have a Python 3 only package that uses matplotlib for the docs.
Currently we have matplotlib listed in
https://github.com/cta-observatory/ctapipe/blob/master/docs/rtd-pip-requirements
Is that the right thing to do or should we remove it because matplotlib is available system-wide for Python 3?

Build error:
https://readthedocs.org/builds/ctapipe/3001202/

Collecting matplotlib (from -r docs/rtd-pip-requirements (line 2))
  Using cached matplotlib-1.4.3.tar.gz
    Complete output from command python setup.py egg_info:
    IMPORTANT WARNING:
        pkg-config is not installed.
        matplotlib may not be able to find some of its dependencies
    ============================================================================
    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 [not found. pip may install it below.]
                       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 [using pytz version 2015.4]
                   tornado: yes [using tornado version 4.2]
                 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.]
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-v2u7hzf0/matplotlib/setup.py", line 155, in <module>
        result = package.check()
      File "/tmp/pip-build-v2u7hzf0/matplotlib/setupext.py", line 961, in check
        min_version='2.3', version=version)
      File "/tmp/pip-build-v2u7hzf0/matplotlib/setupext.py", line 445, in _check_for_pkg_config
        if (not is_min_version(version, min_version)):
      File "/tmp/pip-build-v2u7hzf0/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()

@gregmuellegger
Copy link
Contributor

@cdeil The safest bet here is to remove the matplotlib dependency from the requirements file and mock out the library for the build like explained in the FAQs.

@gregmuellegger gregmuellegger added the Bug A bug label Sep 14, 2015
@cdeil
Copy link

cdeil commented Sep 14, 2015

We're using the matplotlib Sphinx plot directive to generate Figures during the Sphinx build.
So if we mock out matplotlib, those Figures will not be generated and the docs are incomplete.

@gregmuellegger
Copy link
Contributor

@cdeil oops, completely missed that. Removing matplotlib from the requirements and activating the "use system site packages" switch in the admin panel on readthedocs.org should make it work then -- as long as matplotlib is installed for Python 3. Which is not currently.

We'll fix that!

@ankostis
Copy link
Contributor

@cdeil When you fix it, update also #896.

@gregmuellegger
Copy link
Contributor

This is finally fixed on our build servers. You can use matplotlib in Python 3 projects now. Thanks for the report and persistence!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Operations Operations or server issue
Projects
None yet
Development

No branches or pull requests

4 participants