Skip to content
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

BUG: Numpy 2.0.0: import error from graph_tool #26736

Closed
WhiteSymmetry opened this issue Jun 17, 2024 · 3 comments
Closed

BUG: Numpy 2.0.0: import error from graph_tool #26736

WhiteSymmetry opened this issue Jun 17, 2024 · 3 comments
Labels

Comments

@WhiteSymmetry
Copy link

WhiteSymmetry commented Jun 17, 2024

Describe the issue:

Numpy 2.0.0: (graph-tool: 2.69 & 2.70)
from graph_tool.all import *
File "//lib/python3.11/site-packages/graph_tool/init.py", line 118, in
dl_import("from . import libgraph_tool_core as libcore")
File "/
/lib/python3.11/site-packages/graph_tool/dl_import.py", line 44, in dl_import
exec(import_expr, local_dict, global_dict)
File "", line 1, in

line 44:
try:
exec(import_expr, local_dict, global_dict)
finally:
sys.setdlopenflags(orig_dlopen_flags) # reset it to normal case to

avoid unnecessary symbol

collision

Executing: from . import libgraph_tool_core as libcore

Numpy:1.x
It doesn’t give an error in numpy 1.x.

Reproduce the code example:

import graph_tool.all as gt
from numpy.random import random

Error message:

from graph_tool.all import *
File "/*/lib/python3.11/site-packages/graph_tool/__init__.py", line 118, in <module>
    dl_import("from . import libgraph_tool_core as libcore")
File "/*/lib/python3.11/site-packages/graph_tool/dl_import.py", line 44, in dl_import
    exec(import_expr, local_dict, global_dict)
File "<string>", line 1, in <module>

Python and NumPy Versions:

Python: 3.11.9
Numpy: 2.0.0

Runtime Environment:

[{'numpy_version': '2.0.0',
'python': '3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:53:30) '
'[GCC 12.3.0]',
'uname': uname_result(system='Linux', node='', release='6.9.3-060903-generic', version='#202405300957 SMP PREEMPT_DYNAMIC Thu May 30 11:39:13 UTC 2024', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['POPCNT'],
'not_found': ['SSSE3',
'SSE41',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2',
'AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_KNM',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}},
{'architecture': 'Prescott',
'filepath': '/home/
/miniconda3/envs/x11/lib/python3.11/site-packages/numpy.libs/libscipy_openblas64_-99b71e71.so',
'internal_api': 'openblas',
'num_threads': 4,
'prefix': 'libscipy_openblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.27'}]

Context for the issue:

Kernel Restarting

@WhiteSymmetry WhiteSymmetry changed the title BUG: <Please write a comprehensive title after the 'BUG: ' prefix> Numpy 2.0.0: import error from graph_tool Jun 17, 2024
@WhiteSymmetry WhiteSymmetry changed the title Numpy 2.0.0: import error from graph_tool BUG: Numpy 2.0.0: import error from graph_tool Jun 17, 2024
@rkern
Copy link
Member

rkern commented Jun 17, 2024

Packages that have extension modules that import numpy (like graph-tool) need to be rebuilt against numpy 2.0. You cannot use graph-tool binaries that have been built against numpy 1.x and just install numpy 2.0 alongside. Did you rebuild graph-tool, or are you using older binaries?

@WhiteSymmetry
Copy link
Author

I tried it on both the old installation and the new conda and mamba installation. Either way, it fails. But I didn't try it because the graph-tool takes a long time to compile on the system.

@seberg
Copy link
Member

seberg commented Jun 18, 2024

A bit unclear how it's failing, but indeed: it presumably needs to be rebuild (and may need smaller code fixes). The easiest fix is maybe to just wait a while for conda-forge to build a compatible version.

Closing, I didn't find a tracking issue for graph-tool and it doesn't look like pypi releases are still done for it. But we could add it to the NumPy tracking issue (26191), especially with a tracking issue.

@seberg seberg closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants