question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

osx cpu only version fails with missing native library: symbol not found

See original GitHub issue

https://stackoverflow.com/questions/67455890/pytorch-cpu-only-on-osx-fails-with-symbol-not-found

I am trying to get started with PyTorch - on a mac osx computer. However, basic steps fail:

    from torch_sparse import coalesce, SparseTensor
    
    ---------------------------------------------------------------------------
    OSError                                   Traceback (most recent call last)
    <ipython-input-1-dad8246d5249> in <module>
    ----> 1 from torch_sparse import coalesce, SparseTensor
    
    /usr/local/Caskroom/miniconda/base/envs/my_conda_env/lib/python3.8/site-packages/torch_sparse/__init__.py in <module>
         10         '_saint', '_padding'
         11 ]:
    ---> 12     torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
         13         library, [osp.dirname(__file__)]).origin)
         14 
    
    /usr/local/Caskroom/miniconda/base/envs/my_conda_env/lib/python3.8/site-packages/torch/_ops.py in load_library(self, path)
        102             # static (global) initialization code in order to register custom
        103             # operators with the JIT.
    --> 104             ctypes.CDLL(path)
        105         self.loaded_libraries.add(path)
        106 
    
    /usr/local/Caskroom/miniconda/base/envs/my_conda_env/lib/python3.8/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
        371 
        372         if handle is None:
    --> 373             self._handle = _dlopen(self._name, mode)
        374         else:
        375             self._handle = handle
    
    OSError: dlopen(/usr/local/Caskroom/miniconda/base/envs/my_conda_env/lib/python3.8/site-packages/torch_sparse/_version.so, 6): Symbol not found: __ZN3c105ErrorC1ENS_14SourceLocationERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE
      Referenced from: /usr/local/Caskroom/miniconda/base/envs/my_conda_env/lib/python3.8/site-packages/torch_sparse/_version.so
      Expected in: flat namespace
     in /usr/local/Caskroom/miniconda/base/envs/my_conda_env/lib/python3.8/site-packages/torch_sparse/_version.so

I am using a conda environment of:

    name: my_conda_env
    channels:
      - pytorch
      - conda-forge
      - defaults
    dependencies:
      - python>=3.8
      - pytorch
      - pytorch_geometric

and instantiated it using:

conda env create --force -f environment.yml

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
d-miketacommented, Nov 20, 2021

Yeah – I misspoke. For some reason the pip version of torch doesn’t play well with my debugpy==1.5.1 on macOS (it crashes with code 245). So thinking about it again I don’t think this is a pyg issue at all, sorry about that.

1reaction
geoHeilcommented, May 9, 2021

Indeed, https://github.com/conda-forge/pytorch_sparse-feedstock/issues/13 is the problem The manual installation of pytorch geometric and its dependencies such as pytorch sparse using pip https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html is a currently suitable workaround

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytorch (cpu only) on osx fails with symbol not found
I am trying to get started with PyTorch - on a mac osx computer. However, basic steps fail:
Read more >
dyld: Symbol not found: swift34swi… | Apple Developer Forums
This issue happens for chained dependencies. Suppose you have App -> A.framework -> B.framework. If you change B's target OS version and rebuilt...
Read more >
Steam/Troubleshooting - ArchWiki
If individual games or Steam itself is failing to launch when using steam-native you are probably missing libraries. To find the required ...
Read more >
Shrink, obfuscate, and optimize your app - Android Developers
Code shrinking (or tree-shaking): detects and safely removes unused classes, fields, methods, and attributes from your app and its library dependencies (making ...
Read more >
Building the JDK - OpenJDK
If configure fails due to missing dependencies (to either the toolchain, build tools, external libraries or the boot JDK), most of the time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found