-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ValueError: module functions cannot set METH_CLASS or METH_STATIC #23040
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
Comments
@joh I personally could not reproduce this bug, but digging into my |
I'm also not able to reproduce. @joh how did you install pandas and matplotlib? |
I upgraded matplotlib to 3.0.0 via pip:
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Linux
OS-release: 4.18.8-041808-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.23.4 I still get the same error:
@TomAugspurger I installed both pandas and matplotlib through pip. |
@joh do you have the install log? Or can you reinstall pandas and matplotlib in a virtualenv and post the output? Something is going wrong with that C file. |
@TomAugspurger I installed pandas and matplotlib in a virtualenv and discovered that I only get the error if matplotlib is configured to use the GTK3Agg or GTK3Cairo backend. |
Ah, hmm. This is beginning to sound like #19706 but with a different error message. None of the pandas or matplotlib devs are able to reproduce it :/ |
I get the same error :
But when I change import order then the error doesn't occur. |
Any debugging you can do would be appreciated.
…On Sun, Oct 14, 2018 at 2:02 PM Dominik Orliński ***@***.***> wrote:
I get the same error :
Traceback (most recent call last):
File "start.py", line 20, in <module>
import FlowCal
File "/home/dominik/.local/lib/python3.6/site-packages/FlowCal/__init__.py", line 12, in <module>
from . import excel_ui
File "/home/dominik/.local/lib/python3.6/site-packages/FlowCal/excel_ui.py", line 98, in <module>
import pandas as pd
File "/home/dominik/.local/lib/python3.6/site-packages/pandas/__init__.py", line 57, in <module>
from pandas.io.api import *
File "/home/dominik/.local/lib/python3.6/site-packages/pandas/io/api.py", line 19, in <module>
from pandas.io.packers import read_msgpack, to_msgpack
File "/home/dominik/.local/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
But when I change import order then the error doesn't occur.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#23040 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIqh1GPMr_nhAAiBEY4QQ5TLlJKE0ks5uk4o8gaJpZM4XMa4h>
.
|
…s-dev#19706) There appears to be symbol collisions with matplotlib in `pandas/util/move.c`. Make symbols that are not intended to be exported static, so they are neither exported nor dynamically resolved.
Got same error as well:
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. |
I've reduced this down to: import ctypes
ctypes.CDLL("libgtk-3.so.0", ctypes.RTLD_GLOBAL)
import pandas |
This loads
which conflicts with Line 188 in 9f2c716
Presumably internal linkage should be used in both cases. EDIT: I opened marge request for at-spi2-atk: https://gitlab.gnome.org/GNOME/at-spi2-atk/merge_requests/2. |
Hopefully fixed by #24113. |
…rary If pandas is imported after some other libraries, the operation fails https://askubuntu.com/questions/1081651/failing-to-import-pandas-in-anjuta-module-functions-cannot-set-meth-class-or-me pandas-dev/pandas#23040
I recently encountered this error after a system update (pandas itself was not updated, but other things were). It was fixed by moving to a post- Since it was neither a pandas nor a statsmodels update which lead to this issue materializing on my system, I was wondering if perhaps you have any advice regarding what else I could try to temporarily downgrade. |
At least for this specific problem the other package is |
sudo -H pip3 uninstall matplotlib
sudo -H apt-get install python3-matplotlib Fixed |
I've experienced today a similar problem, below the traceback: Traceback (most recent call last): File "/home/bombolo/PycharmProjects/mulder-algo/mulder_algo/run_mulder.py", line 6, in from mulder_algo.agent_aggregator import AgentAggregator File "/home/bombolo/PycharmProjects/mulder-algo/mulder_algo/agent_aggregator.py", line 7, in from optisim.utils import InputDataManager File "/home/bombolo/PycharmProjects/optisim/optisim/__init__.py", line 2, in from . import agents File "/home/bombolo/PycharmProjects/optisim/optisim/agents/__init__.py", line 2, in from . import boiler File "/home/bombolo/PycharmProjects/optisim/optisim/agents/boiler.py", line 9, in from .heat_pump import HeatPump File "/home/bombolo/PycharmProjects/optisim/optisim/agents/heat_pump.py", line 4, in import pandas as pd File "/home/bombolo/PycharmProjects/optisim/venv/lib/python3.6/site-packages/pandas/__init__.py", line 57, in from pandas.io.api import * File "/home/bombolo/PycharmProjects/optisim/venv/lib/python3.6/site-packages/pandas/io/api.py", line 19, in from pandas.io.packers import read_msgpack, to_msgpack File "/home/bombolo/PycharmProjects/optisim/venv/lib/python3.6/site-packages/pandas/io/packers.py", line 69, in from pandas.util._move import ( ValueError: module functions cannot set METH_CLASS or METH_STATIC After a hour of fighting I solved the problem creating a new venv based on Python3.6.8 (before it was 3.6.7-based). I hope this can help. |
import pandas as pd I have faced the same error, I re-arranged the import order. It was working fine for me. Thanks |
Thanks, it solved my problem as well. Any idea how this resolves the issue? |
When I update pandas then problem got solved |
Code Sample, a copy-pastable example if possible
Problem description
If I import pyplot before pandas, I get the following error:
If I re-order the imports so that pandas is imported first, the error disappears. Not sure if this is an issue with pyplot or pandas, but the exception seems to come from within pandas.
Expected Output
Output of
pd.show_versions()
pandas: 0.23.4
pytest: 3.8.0
pip: 9.0.1
setuptools: 40.4.3
Cython: None
numpy: 1.15.2
scipy: 0.19.1
pyarrow: None
xarray: None
IPython: 5.5.0
sphinx: 1.6.7
patsy: None
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: 1.2.0
tables: 3.4.2
numexpr: 2.6.4
feather: None
matplotlib: 2.1.1
openpyxl: 2.4.9
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml: 4.2.1
bs4: 4.6.0
html5lib: 0.999999999
sqlalchemy: 1.1.11
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: