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

Cannot import dictlearn #3

Open
ke0m opened this issue Oct 2, 2019 · 7 comments
Open

Cannot import dictlearn #3

ke0m opened this issue Oct 2, 2019 · 7 comments

Comments

@ke0m
Copy link

ke0m commented Oct 2, 2019

When i attempt to import dictlearn using python 2.7 I get the following error:

Python 2.7.16 |Anaconda, Inc.| (default, Aug 22 2019, 16:00:36) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dictlearn as dl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dictlearn/__init__.py", line 92, in <module>
    from .algorithms import (
  File "dictlearn/algorithms.py", line 6, in <module>
    from . import optimize, inpaint, sparse
  File "dictlearn/optimize.py", line 10, in <module>
    from . import sparse, preprocess
  File "dictlearn/sparse.py", line 13, in <module>
    from ._dictlearn import _dictlearn
  File "dictlearn/_dictlearn/__init__.py", line 1, in <module>
    from . import _dictlearn
ImportError: cannot import name _dictlearn

Any advice you can give for resolving this issue would be greatly appreciated.

Thanks

@YoruCathy
Copy link

I attempted to import dictlearn with python3.7 and met the same error. Have you solved this problem?

@YoruCathy
Copy link

Still cannot import dictlearn with python 3.6

@ke0m
Copy link
Author

ke0m commented Oct 26, 2019

Yes, I did solve it. I made the silly mistake of not running python setup.py install. All of the examples (apart from the paths to the images not being correct) and the tests work for me in python 2 and 3.

@YoruCathy
Copy link

In fact I did run python setup.py install. But I still cannot import it.
When I run the tests I got this. Is it normall?
image

@ke0m
Copy link
Author

ke0m commented Oct 30, 2019

Yes, I get a similar output

================================= 63 passed, 4 skipped, 56 warnings in 18.15s ==================================

Have you tried running the examples?

@YoruCathy
Copy link

Nope, I cannot include it. But I have realized the function I want by using a single function in this package.

@mukheshpugal
Copy link

I have a similar issue when trying to import the module on Ubuntu 18.04 running python 3.6. Find the traceback below:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/env/lib/python3.6/site-packages/dictlearn-0.0.1-py3.6-linux-x86_64.egg/dictlearn/__init__.py", line 92, in <module>
    from .algorithms import (
  File "/home/ubuntu/env/lib/python3.6/site-packages/dictlearn-0.0.1-py3.6-linux-x86_64.egg/dictlearn/algorithms.py", line 6, in <module>
    from . import optimize, inpaint, sparse
  File "/home/ubuntu/env/lib/python3.6/site-packages/dictlearn-0.0.1-py3.6-linux-x86_64.egg/dictlearn/optimize.py", line 10, in <module>
    from . import sparse, preprocess
  File "/home/ubuntu/env/lib/python3.6/site-packages/dictlearn-0.0.1-py3.6-linux-x86_64.egg/dictlearn/sparse.py", line 13, in <module>
    from ._dictlearn import _dictlearn
  File "/home/ubuntu/env/lib/python3.6/site-packages/dictlearn-0.0.1-py3.6-linux-x86_64.egg/dictlearn/_dictlearn/__init__.py", line 1, in <module>
    from . import _dictlearn
ImportError: /home/ubuntu/env/lib/python3.6/site-packages/dictlearn-0.0.1-py3.6-linux-x86_64.egg/dictlearn/_dictlearn/_dictlearn.cpython-36m-x86_64-linux-gnu.so: undefined symbol: omp_get_thread_num

This does not happen in windows.

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

3 participants