Skip to content

plotnine compilation issue in Python 3.7 #178

Description

@aflueckiger

I am not sure about the following error that I get when trying to install plotnine in the environment of Python 3.7. Do I miss a pre-requirement or is this issue related with the one describe here, which caused by an old cython version that was used for the build?:
pandas-dev/pandas#21785

sudo pip install plotnine

...PRUNED BY ME...

    In file included from /usr/include/python3.7m/Python.h:128,
                     from _proj.c:4:
    /usr/include/python3.7m/abstract.h:500:17: note: declared here
     PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj,
                     ^~~~~~~~~~~~~~~~~~~~~~
    _proj.c: In function ‘__Pyx_ExceptionSave’:
    _proj.c:7421:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         *type = tstate->exc_type;
                         ^~~~~~~~
                         curexc_type
    _proj.c:7422:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         *value = tstate->exc_value;
                          ^~~~~~~~~
                          curexc_value
    _proj.c:7423:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         *tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
                       curexc_traceback
    _proj.c: In function ‘__Pyx_ExceptionReset’:
    _proj.c:7435:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
                            curexc_type
    _proj.c:7436:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
                             curexc_value
    _proj.c:7437:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
                          curexc_traceback
    _proj.c:7438:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = type;
                 ^~~~~~~~
                 curexc_type
    _proj.c:7439:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = value;
                 ^~~~~~~~~
                 curexc_value
    _proj.c:7440:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = tb;
                 ^~~~~~~~~~~~~
                 curexc_traceback
    _proj.c: In function ‘__Pyx_GetException’:
    _proj.c:7483:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
                            curexc_type
    _proj.c:7484:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
                             curexc_value
    _proj.c:7485:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
                          curexc_traceback
    _proj.c:7486:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = local_type;
                 ^~~~~~~~
                 curexc_type
    _proj.c:7487:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = local_value;
                 ^~~~~~~~~
                 curexc_value
    _proj.c:7488:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = local_tb;
                 ^~~~~~~~~~~~~
                 curexc_traceback
    error: command 'gcc' failed with exit status 1

Thanks for any help. And keep up the great project, I am a happy user of plotnine for more than a year.

Activity

  1. changed the title [-]plotnine compilation problems in Python 3.7[/-] [+]plotnine compilation issue in Python 3.7[/+] on Aug 19, 2018
  2. has2k1 commented on Aug 20, 2018

    @has2k1
    Owner

    I do not think this is a plotnine issue, plotnine is pure python. It should be one of the dependencies that has cython code. Try installing pandas first then plotnine.

  3. aflueckiger commented on Aug 20, 2018

    @aflueckiger
    Author

    @has2k1 Thanks for your answer. After some research and fiddling around I assume the issue is caused by the package pyproj, which is a dependency of geopandas, which is itself a dependency of plotnine. Any attempt to directly install pyproj fails because it probably uses old, precompiled cython files (see pyproj4/pyproj#136).

    The simple solution is to install plotnine without further dependencies (i.e. pyproj) using the following command: pip install -U --no-deps plotnine

  4. has2k1 commented on Sep 2, 2018

    @has2k1
    Owner

    There is no hint of when pyproj will make a release that fixes issue. We are at their mercy.

    Matplotlib 3.0.0 will come out soon (the release candidates are up) and it is for Python 3.5 and above. A Plotnine release that also supports Python 3.5 and above has to come out before or soon after Matplotlib, but with the pyproj blocker we have to make choices. So for the next release of Plotnine, on Python 3.7 only, it will install without the geopandas requirement (it pulls in pyproj) hence geom_map will not work.

  5. jorisvandenbossche commented on Sep 12, 2018

    @jorisvandenbossche

    Made the comment also in conda-forge/plotnine-feedstock#6: even without this pyproj / python 3.7 issue, I would personally advice against having geopandas as a required dependency (at least at this moment; and I am the geopandas maintainer, so I am allowed to say this :-)).
    You can still have it as an optional dependency of course, and give an informative error message when people try geom_map without having geopandas installed.

    The problem with geopandas is that it pulls in the complete gdal stack which is still, although it has improved a lot over the last years, often problematic to install.

  6. has2k1 commented on Sep 12, 2018

    @has2k1
    Owner

    @jorisvandenbossche, thank you for the advice, I will do as suggested.

  7. added 3 commits that reference this issue on Sep 12, 2018
    c320657
    1091d29
    24c4d3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions