question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

plotnine compilation issue in Python 3.7

See original GitHub issue

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?: https://github.com/pandas-dev/pandas/issues/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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
aflueckigercommented, Aug 20, 2018

@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 https://github.com/jswhit/pyproj/issues/136).

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

0reactions
has2k1commented, Sep 12, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plotnine: Grammar of Graphics for Python
plotnine is a data visualisation package for Python based on the grammar of ... A DataFrame is a rectangular collection of variables (in...
Read more >
python - No module named 'plotnine' error - despite successful ...
I have pip installed plotline version 0.8.0 to my conda environment and can see it listed when I type 'pip list' with all...
Read more >
Yet More Coding — Coding for Economists - GitHub Pages
This chapter covers some of the most advanced programming concepts you're likely to run into when coding in Python. It's not strictly necessary...
Read more >
Resolved: Matplotlib figures not showing up or displaying
The issue actually stems from the matplotlib backend not being properly set, or from a missing dependency when compiling and installing ...
Read more >
Fastai v0.7 install issues thread - Part 1 (2018)
For fastai-v1 installation issue please refer to this thread i… ... conda create -n fai_course python=3.7 source activate fai_course conda ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found