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

scnym not working; Reason: image not found #2

Closed
Brunox13 opened this issue Mar 6, 2020 · 2 comments
Closed

scnym not working; Reason: image not found #2

Brunox13 opened this issue Mar 6, 2020 · 2 comments

Comments

@Brunox13
Copy link

Brunox13 commented Mar 6, 2020

I followed the installation instructions and when I run

scnym --help

I get the following:

(scnym_env) user-comp:scnym user$ scnym --help
Traceback (most recent call last):
  File "/Users/user/anaconda3/envs/scnym_env/bin/scnym", line 11, in <module>
    load_entry_point('scnym==0.1', 'console_scripts', 'scnym')()
  File "/Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
    return ep.load()
  File "/Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2445, in load
    return self.resolve()
  File "/Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2451, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/user/anaconda3/scnym/scnym/__init__.py", line 8, in <module>
    from . import dataprep, model, predict, trainer, utils
  File "/Users/user/anaconda3/scnym/scnym/dataprep.py", line 1, in <module>
    import torch
  File "/Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/torch/__init__.py", line 79, in <module>
    from torch._C import *
ImportError: dlopen(/Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so, 9): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
  Referenced from: /Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/torch/lib/libshm.dylib
  Reason: image not found

I get a similar error when I open a jupyter notebook and try to import scnym:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-116a8c9e65d1> in <module>
----> 1 import scnym
      2 from scnym.predict import Predicter

~/anaconda3/envs/scnym_env/lib/python3.7/site-packages/scnym-0.1-py3.7.egg/scnym/__init__.py in <module>
      6 # e.g.
      7 # >> from scnym.model import CellTypeCLF
----> 8 from . import dataprep, model, predict, trainer, utils

~/anaconda3/envs/scnym_env/lib/python3.7/site-packages/scnym-0.1-py3.7.egg/scnym/dataprep.py in <module>
----> 1 import torch
      2 import numpy as np
      3 from torch.utils.data import Dataset
      4 from typing import Callable
      5 

~/anaconda3/envs/scnym_env/lib/python3.7/site-packages/torch/__init__.py in <module>
     77 del _dl_flags
     78 
---> 79 from torch._C import *
     80 
     81 __all__ += [name for name in dir(_C)

ImportError: dlopen(/Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so, 9): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
  Referenced from: /Users/user/anaconda3/envs/scnym_env/lib/python3.7/site-packages/torch/lib/libshm.dylib
  Reason: image not found
@Brunox13
Copy link
Author

Brunox13 commented Mar 6, 2020

I solved the problem by running the following:

brew install libomp

As suggested here: Pytorch issue #20030

@Brunox13 Brunox13 closed this as completed Mar 6, 2020
@jacobkimmel
Copy link
Contributor

Glad this was fixed, thanks for documenting.

Just FYI, scNym training will be very slow without a modern GPU. Most Macs are sadly lacking in that department. Inference (predicting using pre-trained models) should still be fairly fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants