Open semihcanturk opened 1 year ago
Turns out a (partial) solution is available in the pytorch_geometric repo, which is simply uninstalling pyg-lib: https://github.com/pyg-team/pytorch_geometric/issues/6530#issue-1559763529. Nevertheless keeping this issue open as this is likely to be undesirable behavior.
Please see my comment in https://github.com/pyg-team/pyg-lib/issues/211#issuecomment-1478934645.
That didn't work unfortunately, but I managed to resolve the issues by reinstalling all packages from source. I think that way it updates the DYLD_LIBRARY_PATH
correctly during setup.
pip install git+https://github.com/pyg-team/pyg-lib.git
pip install git+https://github.com/rusty1s/pytorch_sparse.git
pip install git+https://github.com/rusty1s/pytorch_scatter.git
pip install git+https://github.com/rusty1s/pytorch_cluster.git
I hit the same issue today :( I tried many different things, but in all scenarios the final binary was searching for a Python folder in /Library/Frameworks/Python.framework/Versions
. Installing it from the universal install at https://www.python.org/downloads/macos/ fixed it for me.
It seems that even installing from Python official solves it, but the error message changes somewhat @rusty1s.
Traceback (most recent call last):
File "/Users/adrielmartins/Documents/gcaptain/testingsomething.py", line 1, in <module>
import pyg_lib
File "/Users/adrielmartins/Documents/gcaptain/.venv/lib/python3.11/site-packages/pyg_lib/__init__.py", line 39, in <module>
load_library('libpyg')
File "/Users/adrielmartins/Documents/gcaptain/.venv/lib/python3.11/site-packages/pyg_lib/__init__.py", line 36, in load_library
torch.ops.load_library(spec.origin)
File "/Users/adrielmartins/Documents/gcaptain/.venv/lib/python3.11/site-packages/torch/_ops.py", line 1295, in load_library
ctypes.CDLL(path)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 376, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(/Users/adrielmartins/Documents/gcaptain/.venv/lib/python3.11/site-packages/libpyg.so, 0x0006): Symbol not found: __ZN3c1010Dispatcher17runRecordFunctionERN2at14RecordFunctionENSt3__117reference_wrapperIKNS_14FunctionSchemaEEENS_11DispatchKeyE
Referenced from: <75FFC412-93B5-322B-8E6D-268DA3498CF4> /Users/adrielmartins/Documents/gcaptain/.venv/lib/python3.11/site-packages/libpyg.so
Expected in: <9C467D80-5BAC-3156-B480-F0FF7E45DEF2> /Users/adrielmartins/Documents/gcaptain/.venv/lib/python3.11/site-packages/torch/lib/libtorch_cpu.dylib
It seems that is still expecting packages elsewhere. I'm running this on M3 Pro Mac, using Python3.11.8, torch 2.3.0, torch_geometric >=2.5.3.
Do you have any other proposal, please?
🐛 Describe the bug
I'm unable to get pyg-lib to import on my Mac. It seems to affect both Intel and M1 Macs (I'm on an Intel, but an M1 user reported the same issue: https://github.com/pyg-team/pyg-lib/issues/211#issuecomment-1467254168). The original issue in the thread may not be relevant, thus I'm opening a new issue.
Minimal example is simply importing pyg_lib:
In my case, I was importing
torch_geometric.graphgym.config
, resulting in the following stack trace:Environment
pyg-lib
version: 0.1.0/latest from source(0.1.0+pt113)pyg-lib
(conda
,pip
, source): Both, see belowThings I've tried: