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

Difficulty with bm25_weight in Linux install #21

Closed
angusturner opened this issue Mar 2, 2017 · 15 comments
Closed

Difficulty with bm25_weight in Linux install #21

angusturner opened this issue Mar 2, 2017 · 15 comments

Comments

@angusturner
Copy link

On Ubuntu 16.04, when I try to import the bm25_weight function I get the following error:

import implicit
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/implicit/init.py", line 3, in
from . import nearest_neighbours
File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/implicit/nearest_neighbours.py", line 7, in
from ._nearest_neighbours import all_pairs_knn
ImportError: /home/ubuntu/anaconda3/lib/python3.6/site-packages/implicit/_nearest_neighbours.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZdlPvm

@angusturner
Copy link
Author

Note, the same code works on Mac OS X. Have tried with Python 3.5 and 3.6 on Ubuntu with no luck.

@benfred
Copy link
Owner

benfred commented Mar 2, 2017

This seems like the same issue as here: Theano/Theano#5141 Can you try the steps listed and see if that fixes?

@benfred
Copy link
Owner

benfred commented May 3, 2017

duplicate of #23

@benfred benfred closed this as completed May 3, 2017
@tme2120
Copy link

tme2120 commented Oct 29, 2017

I have the same issue but my error is a bit different, can you please detail the steps to fix this? I was not able to follow the steps in the link you provided above
Traceback (most recent call last):
File "", line 1, in
File "/Users/admin/anaconda3/lib/python3.6/site-packages/implicit/init.py", line 1, in
from .als import alternating_least_squares
File "/Users/admin/anaconda3/lib/python3.6/site-packages/implicit/als.py", line 10, in
from . import _als
ImportError: dlopen(/Users/admin/anaconda3/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so, 2): Symbol not found: _GOMP_parallel
Referenced from: /Users/admin/anaconda3/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so
Expected in: flat namespace
in /Users/admin/anaconda3/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so

@benfred
Copy link
Owner

benfred commented Nov 2, 2017

@tme2120 A similar issue was reported here: #13 - and apparently going 'conda install -y gcc' before installing implicit fixes. Can you try that?

@tme2120
Copy link

tme2120 commented Nov 8, 2017

@benfred I tried doing that and it still wouldn't work. Any other ideas I can try please? Would really appreciate it!

Update: this worked only after starting a brand new conda environment and installing running "conda install gcc" before installing implicit. It did not work by uninstalling implicit from the old environment, installing gcc and then reinstalling implicit for some reason.

@luebken
Copy link

luebken commented Nov 16, 2017

🙋‍ Ran into the same problem on a Mac.

Going through the comments above and the links didn't help so far:

  • A pip uninstall implicit & conda install -y gcc & pip install implicit didn't help.
  • A fresh install of anaconda with homebrew didn't help.
  • Not sure how to downgrade to gcc 5 as suggested somewhere

my setup:

$ uname -v
Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64
$ gcc --version
gcc (GCC) 4.8.5
$ brew cask info anaconda
anaconda: 5.0.1
$ python --version
Python 3.6.3 :: Anaconda, Inc.
$ anaconda --version
anaconda Command line client (version 1.6.5)
$ conda info
Current conda install:

               platform : osx-64
          conda version : 4.3.30
       conda is private : False
      conda-env version : 4.3.30
    conda-build version : 3.0.27
         python version : 3.6.3.final.0
       requests version : 2.18.4
       root environment : /usr/local/anaconda3  (writable)
    default environment : /usr/local/anaconda3
       envs directories : /usr/local/anaconda3/envs
                          /Users/mdl/.conda/envs
          package cache : /usr/local/anaconda3/pkgs
                          /Users/mdl/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/main/osx-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/osx-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/osx-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : None
             netrc file : /Users/mdl/.netrc
           offline mode : False
             user-agent : conda/4.3.30 requests/2.18.4 CPython/3.6.3 Darwin/15.3.0 OSX/10.11.3

@benfred
Copy link
Owner

benfred commented Nov 16, 2017

@luebken There were two errors reported here previously in this thread =( Which one are you hitting - The 'Symbol not found: _GOMP_parallel' error or the 'undefined symbol: _ZdlPvm' one? Can you post the build output/error here ?

@benfred benfred reopened this Nov 16, 2017
@luebken
Copy link

luebken commented Nov 16, 2017

I'm seeing the Symbol not found: _GOMP_parallel error:

Traceback (most recent call last):
  File "actions/main/main.py", line 6, in <module>
    from implicit.als import AlternatingLeastSquares
  File "/usr/local/anaconda3/lib/python3.6/site-packages/implicit/__init__.py", line 1, in <module>
    from .als import alternating_least_squares
  File "/usr/local/anaconda3/lib/python3.6/site-packages/implicit/als.py", line 10, in <module>
    from . import _als
ImportError: dlopen(/usr/local/anaconda3/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so, 2): Symbol not found: _GOMP_parallel
  Referenced from: /usr/local/anaconda3/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so
  Expected in: flat namespace
 in /usr/local/anaconda3/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so
make: *** [local] Error 1
 

@benfred
Copy link
Owner

benfred commented Jan 17, 2018

@luebken I believe this fixes the Symbol not found: _GOMP_parallel error on OSX https://github.com/benfred/implicit/pull/

@benfred benfred closed this as completed Jan 17, 2018
@zacharydestefano
Copy link

zacharydestefano commented Jan 29, 2018

@benfred I am still getting the following error:
'Symbol not found: _GOMP_parallel'

I am using Mac. I tried what @luebken tried and it also did not work for me.

More specifically, when I run the code import implicit from a jupyter notebook cell, I get the following traceback:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-1eb90d3051a8> in <module>()
----> 1 import implicit

~/miniconda3/envs/collabenv/lib/python3.6/site-packages/implicit/__init__.py in <module>()
----> 1 from .als import alternating_least_squares
      2 
      3 from . import nearest_neighbours
      4 from . import als
      5 

~/miniconda3/envs/collabenv/lib/python3.6/site-packages/implicit/als.py in <module>()
      8 import scipy
      9 
---> 10 from . import _als
     11 from .recommender_base import RecommenderBase
     12 from .utils import check_open_blas, nonzeros

ImportError: dlopen(/Users/newscred/miniconda3/envs/collabenv/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so, 2): Symbol not found: _GOMP_parallel
  Referenced from: /Users/newscred/miniconda3/envs/collabenv/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/newscred/miniconda3/envs/collabenv/lib/python3.6/site-packages/implicit/_als.cpython-36m-darwin.so

Running the same commands as @luebken here is my setup:

(collabenv) ZacharyDeStefano:~ newscred$ uname -v
Darwin Kernel Version 17.3.0: Thu Nov  9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64
(collabenv) ZacharyDeStefano:~ newscred$ gcc --version
gcc (GCC) 4.8.5
(collabenv) ZacharyDeStefano:~ newscred$ brew cask info anaconda
anaconda: 5.0.1
(collabenv) ZacharyDeStefano:~ newscred$ python --version
Python 3.6.4 :: Anaconda, Inc.
(collabenv) ZacharyDeStefano:~ newscred$ conda info

     active environment : collabenv
    active env location : /Users/newscred/miniconda3/envs/collabenv
            shell level : 1
       user config file : /Users/newscred/.condarc
 populated config files : 
          conda version : 4.4.4
    conda-build version : not installed
         python version : 3.6.3.final.0
       base environment : /Users/newscred/miniconda3  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/osx-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/osx-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/osx-64
                          https://repo.continuum.io/pkgs/pro/noarch
          package cache : /Users/newscred/miniconda3/pkgs
                          /Users/newscred/.conda/pkgs
       envs directories : /Users/newscred/miniconda3/envs
                          /Users/newscred/.conda/envs
               platform : osx-64
             user-agent : conda/4.4.4 requests/2.18.4 CPython/3.6.3 Darwin/17.3.0 OSX/10.13.2
                UID:GID : 503:20
             netrc file : None
           offline mode : False

@benfred
Copy link
Owner

benfred commented Jan 29, 2018

@zacharydestefano I just pushed a new version to pypi, which includes this fix #73 (previous comment didn't include the pr number for some reason).

I think this will fix your issue, at least it for me when I encountered the same problem a couple of weeks ago on OSX.

@zacharydestefano
Copy link

Sadly it has not fixed the issue. I still get the same error when I run import implicit

I tried upgrading implicit using pip by running pip install --upgrade implicit however I got the following error

(collabenv) ZacharyDeStefano:implicit newscred$ pip install --upgrade implicit
Collecting implicit
  Using cached implicit-0.2.8.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/lr/ggdl9lfx1rddsydlsbx19tcw0000gq/T/pip-build-j_i7msga/implicit/setup.py", line 9, in <module>
        from cuda_setup import CUDA, build_ext
    ModuleNotFoundError: No module named 'cuda_setup'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/lr/ggdl9lfx1rddsydlsbx19tcw0000gq/T/pip-build-j_i7msga/implicit/

I also cloned the repo and tried running python setup.py build and even though there were no error messages during build, the error with import implicit still occurred when running code.

benfred added a commit that referenced this issue Jan 29, 2018
cuda_setup.py script wasn't being distributed to pypi. Add to
MANIFEST.in to try to fix: #21 (comment)
@benfred
Copy link
Owner

benfred commented Jan 29, 2018

I think the 'cuda_setup' error is something I introduced this morning when fixing another issue. I think this should fix: cc4986c - can you try pip install --upgrade implicit again?

@zacharydestefano
Copy link

I ran it again and it worked! I have been able to import implicit and run my sample code!

Thanks a lot for your help!

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

5 participants