Failing to import pandas in Anjuta “module functions cannot set METH_CLASS or METH_STATIC”











up vote
0
down vote

favorite












I have this boilerplate in a minimal Anjuta app that runs. I do not want to install pandas to the system python path so I am using Virtualenv. When I add import pandas as pd I get the following error message.



Not sure if this is Anjuta or Pandas related. I have googled for the error message but nothing instrumental. What do I do?



#!/home/USERNAME/my_app/bin/python3.6
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GdkPixbuf, Gdk
import os, sys, gi

...

from shutil import copyfile
import pandas as pd
...


And I get this.



EXECUTING:
/home/USERNAME/my_app/src/my_app.py
----------------------------------------------
Traceback (most recent call last):
File "/home/USERNAME/my_app/src/my_app.py", line 35, in <module>
import pandas as pd
File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/__init__.py", line 57, in <module>
from pandas.io.api import *
File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/io/api.py", line 19, in <module>
from pandas.io.packers import read_msgpack, to_msgpack
File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/io/packers.py", line 69, in <module>
from pandas.util._move import (
ValueError: module functions cannot set METH_CLASS or METH_STATIC

----------------------------------------------
Program exited with errcode (1)
Press the Enter key to close this terminal ...


without the import pandas as pd the program runs just fine...



EXECUTING:
/home/USERNAME/my_app/src/my_app.py
----------------------------------------------
/home/USERNAME/my_app/test.xlsx
----------------------------------------------
Program exited with errcode (0)
Press the Enter key to close this terminal ...


The same import pandas as pd runs fine if used from a command line python script from the same directory and same virtualenv. Also it runs when called via subprocess.call() from Anjuta runmode.



I am on Ubuntu 18.04 and have installed Anjuta with apt, pandas with pip install pandas.










share|improve this question




























    up vote
    0
    down vote

    favorite












    I have this boilerplate in a minimal Anjuta app that runs. I do not want to install pandas to the system python path so I am using Virtualenv. When I add import pandas as pd I get the following error message.



    Not sure if this is Anjuta or Pandas related. I have googled for the error message but nothing instrumental. What do I do?



    #!/home/USERNAME/my_app/bin/python3.6
    import gi
    gi.require_version('Gtk', '3.0')
    from gi.repository import Gtk, GdkPixbuf, Gdk
    import os, sys, gi

    ...

    from shutil import copyfile
    import pandas as pd
    ...


    And I get this.



    EXECUTING:
    /home/USERNAME/my_app/src/my_app.py
    ----------------------------------------------
    Traceback (most recent call last):
    File "/home/USERNAME/my_app/src/my_app.py", line 35, in <module>
    import pandas as pd
    File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/__init__.py", line 57, in <module>
    from pandas.io.api import *
    File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/io/api.py", line 19, in <module>
    from pandas.io.packers import read_msgpack, to_msgpack
    File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/io/packers.py", line 69, in <module>
    from pandas.util._move import (
    ValueError: module functions cannot set METH_CLASS or METH_STATIC

    ----------------------------------------------
    Program exited with errcode (1)
    Press the Enter key to close this terminal ...


    without the import pandas as pd the program runs just fine...



    EXECUTING:
    /home/USERNAME/my_app/src/my_app.py
    ----------------------------------------------
    /home/USERNAME/my_app/test.xlsx
    ----------------------------------------------
    Program exited with errcode (0)
    Press the Enter key to close this terminal ...


    The same import pandas as pd runs fine if used from a command line python script from the same directory and same virtualenv. Also it runs when called via subprocess.call() from Anjuta runmode.



    I am on Ubuntu 18.04 and have installed Anjuta with apt, pandas with pip install pandas.










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have this boilerplate in a minimal Anjuta app that runs. I do not want to install pandas to the system python path so I am using Virtualenv. When I add import pandas as pd I get the following error message.



      Not sure if this is Anjuta or Pandas related. I have googled for the error message but nothing instrumental. What do I do?



      #!/home/USERNAME/my_app/bin/python3.6
      import gi
      gi.require_version('Gtk', '3.0')
      from gi.repository import Gtk, GdkPixbuf, Gdk
      import os, sys, gi

      ...

      from shutil import copyfile
      import pandas as pd
      ...


      And I get this.



      EXECUTING:
      /home/USERNAME/my_app/src/my_app.py
      ----------------------------------------------
      Traceback (most recent call last):
      File "/home/USERNAME/my_app/src/my_app.py", line 35, in <module>
      import pandas as pd
      File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/__init__.py", line 57, in <module>
      from pandas.io.api import *
      File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/io/api.py", line 19, in <module>
      from pandas.io.packers import read_msgpack, to_msgpack
      File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/io/packers.py", line 69, in <module>
      from pandas.util._move import (
      ValueError: module functions cannot set METH_CLASS or METH_STATIC

      ----------------------------------------------
      Program exited with errcode (1)
      Press the Enter key to close this terminal ...


      without the import pandas as pd the program runs just fine...



      EXECUTING:
      /home/USERNAME/my_app/src/my_app.py
      ----------------------------------------------
      /home/USERNAME/my_app/test.xlsx
      ----------------------------------------------
      Program exited with errcode (0)
      Press the Enter key to close this terminal ...


      The same import pandas as pd runs fine if used from a command line python script from the same directory and same virtualenv. Also it runs when called via subprocess.call() from Anjuta runmode.



      I am on Ubuntu 18.04 and have installed Anjuta with apt, pandas with pip install pandas.










      share|improve this question















      I have this boilerplate in a minimal Anjuta app that runs. I do not want to install pandas to the system python path so I am using Virtualenv. When I add import pandas as pd I get the following error message.



      Not sure if this is Anjuta or Pandas related. I have googled for the error message but nothing instrumental. What do I do?



      #!/home/USERNAME/my_app/bin/python3.6
      import gi
      gi.require_version('Gtk', '3.0')
      from gi.repository import Gtk, GdkPixbuf, Gdk
      import os, sys, gi

      ...

      from shutil import copyfile
      import pandas as pd
      ...


      And I get this.



      EXECUTING:
      /home/USERNAME/my_app/src/my_app.py
      ----------------------------------------------
      Traceback (most recent call last):
      File "/home/USERNAME/my_app/src/my_app.py", line 35, in <module>
      import pandas as pd
      File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/__init__.py", line 57, in <module>
      from pandas.io.api import *
      File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/io/api.py", line 19, in <module>
      from pandas.io.packers import read_msgpack, to_msgpack
      File "/home/USERNAME/my_app/virtualenv_my_app/my_app/lib/python3.6/site-packages/pandas/io/packers.py", line 69, in <module>
      from pandas.util._move import (
      ValueError: module functions cannot set METH_CLASS or METH_STATIC

      ----------------------------------------------
      Program exited with errcode (1)
      Press the Enter key to close this terminal ...


      without the import pandas as pd the program runs just fine...



      EXECUTING:
      /home/USERNAME/my_app/src/my_app.py
      ----------------------------------------------
      /home/USERNAME/my_app/test.xlsx
      ----------------------------------------------
      Program exited with errcode (0)
      Press the Enter key to close this terminal ...


      The same import pandas as pd runs fine if used from a command line python script from the same directory and same virtualenv. Also it runs when called via subprocess.call() from Anjuta runmode.



      I am on Ubuntu 18.04 and have installed Anjuta with apt, pandas with pip install pandas.







      python application-development virtualenv anjuta






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 7 at 14:10

























      asked Oct 7 at 10:30









      Diego

      228215




      228215






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          It seems to be a problem with python 3.6; I had the same problem except I was using matlibplot, numpy and pandas with the following order:



          import numpy as np
          import matplotlib.pyplot as plt
          import pandas as pd


          And it gave me the same error you got, I rearranged my import order so that it looks like:



          import pandas as pd
          import numpy as np
          import matplotlib.pyplot as plt


          And now it runs well. See this github issue which is very related: https://github.com/pandas-dev/pandas/issues/23040 . Quoting the last user who posted as today named "AlfTang":




          The problem is fixed it by changing pandas import order as suggested. I suspect that the cause is python3.6. When I used python 3.5.2 everything worked fine.







          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1081651%2ffailing-to-import-pandas-in-anjuta-module-functions-cannot-set-meth-class-or-me%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            It seems to be a problem with python 3.6; I had the same problem except I was using matlibplot, numpy and pandas with the following order:



            import numpy as np
            import matplotlib.pyplot as plt
            import pandas as pd


            And it gave me the same error you got, I rearranged my import order so that it looks like:



            import pandas as pd
            import numpy as np
            import matplotlib.pyplot as plt


            And now it runs well. See this github issue which is very related: https://github.com/pandas-dev/pandas/issues/23040 . Quoting the last user who posted as today named "AlfTang":




            The problem is fixed it by changing pandas import order as suggested. I suspect that the cause is python3.6. When I used python 3.5.2 everything worked fine.







            share|improve this answer



























              up vote
              1
              down vote



              accepted










              It seems to be a problem with python 3.6; I had the same problem except I was using matlibplot, numpy and pandas with the following order:



              import numpy as np
              import matplotlib.pyplot as plt
              import pandas as pd


              And it gave me the same error you got, I rearranged my import order so that it looks like:



              import pandas as pd
              import numpy as np
              import matplotlib.pyplot as plt


              And now it runs well. See this github issue which is very related: https://github.com/pandas-dev/pandas/issues/23040 . Quoting the last user who posted as today named "AlfTang":




              The problem is fixed it by changing pandas import order as suggested. I suspect that the cause is python3.6. When I used python 3.5.2 everything worked fine.







              share|improve this answer

























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                It seems to be a problem with python 3.6; I had the same problem except I was using matlibplot, numpy and pandas with the following order:



                import numpy as np
                import matplotlib.pyplot as plt
                import pandas as pd


                And it gave me the same error you got, I rearranged my import order so that it looks like:



                import pandas as pd
                import numpy as np
                import matplotlib.pyplot as plt


                And now it runs well. See this github issue which is very related: https://github.com/pandas-dev/pandas/issues/23040 . Quoting the last user who posted as today named "AlfTang":




                The problem is fixed it by changing pandas import order as suggested. I suspect that the cause is python3.6. When I used python 3.5.2 everything worked fine.







                share|improve this answer














                It seems to be a problem with python 3.6; I had the same problem except I was using matlibplot, numpy and pandas with the following order:



                import numpy as np
                import matplotlib.pyplot as plt
                import pandas as pd


                And it gave me the same error you got, I rearranged my import order so that it looks like:



                import pandas as pd
                import numpy as np
                import matplotlib.pyplot as plt


                And now it runs well. See this github issue which is very related: https://github.com/pandas-dev/pandas/issues/23040 . Quoting the last user who posted as today named "AlfTang":




                The problem is fixed it by changing pandas import order as suggested. I suspect that the cause is python3.6. When I used python 3.5.2 everything worked fine.








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 30 at 3:22

























                answered Nov 27 at 16:24









                Loscil94

                262




                262






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1081651%2ffailing-to-import-pandas-in-anjuta-module-functions-cannot-set-meth-class-or-me%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                    Mangá

                     ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕