Open br0kej opened 1 year ago
What happens if you run pip uninstall pyg_lib
?
It works just fine!
FYI, similar error
$ python -c "import torch_geometric;print(torch_geometric.__version__)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch_geometric/__init__.py", line 4, in <module>
import torch_geometric.data
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch_geometric/data/__init__.py", line 7, in <module>
from .lightning_datamodule import (
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch_geometric/data/lightning_datamodule.py", line 12, in <module>
from torch_geometric.loader import (
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch_geometric/loader/__init__.py", line 4, in <module>
from .neighbor_loader import NeighborLoader
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch_geometric/loader/neighbor_loader.py", line 6, in <module>
from torch_geometric.loader.node_loader import NodeLoader
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch_geometric/loader/node_loader.py", line 20, in <module>
from torch_geometric.sampler.base import (
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch_geometric/sampler/__init__.py", line 2, in <module>
from .neighbor_sampler import NeighborSampler
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch_geometric/sampler/neighbor_sampler.py", line 22, in <module>
import pyg_lib # noqa
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/pyg_lib/__init__.py", line 38, in <module>
load_library('libpyg')
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/pyg_lib/__init__.py", line 35, in load_library
torch.ops.load_library(spec.origin)
File "/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/torch/_ops.py", line 255, in load_library
ctypes.CDLL(path)
File "/Users/victor/.pyenv/versions/3.9.2/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/libpyg.so, 0x0006): Library not loaded: /usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/Python
Referenced from: /Users/victor/.virtualenvs/phast/lib/python3.9/site-packages/libpyg.so
Reason: tried: '/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/3.10/Python' (no such file)
Similar fix uninstalling pyg_lib
pip install torch==1.12.1 pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv torch_geometric -f https://data.pyg.org/whl/torch-1.12.0+cpu.html
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.
🐛 Describe the bug
I am current encountering an error when trying to convert networks graphs to pytorch geometric data on macOS Big Sur 11.7 using Python 3.10.9. It looks like it's an issue with the MacOS build of
pyg
.Code to Re-create Error
The Error
Possible Cause
From having a bit of a google, there are several examples of other issues reporting the errors with GitHub Runners and CI/CD failures (Example) with very similar paths in the error trace. Whilst this deffo' isn't out problem here, the very end of the error
Library not loaded: /Users/runner/hostedtoolcache/Python/3.10.8/x64/lib/libpython3.10.dylib
suggests that an absolute path is being dropped in somewhere to the MacOS build and might be causing this failure?Environment
conda
,pip
, source): piptorch-scatter
): pyg-lib 0.1.0+pt113