lightfm
lightfm copied to clipboard
ModuleNotFoundError: No module named 'lightfm._lightfm_fast_no_openmp' Docker usage fails on macOS:
I have exact same issue as #211 (and I can't reopen it) But I use latest version of repo (and Dockerfile)
I just followed the instructions:
git clone [email protected]:lyst/lightfm.git && cd lightfm
docker-compose build lightfm
docker-compose run lightfm py.test -x lightfm/tests/
then I got this error:
~/Desktop/lightfm
docker-compose run lightfm py.test -x lightfm/tests/
=========================================================== test session starts ============================================================
platform linux -- Python 3.7.7, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
rootdir: /home/lightfm
collected 0 items / 1 error
================================================================== ERRORS ==================================================================
____________________________________________________ ERROR collecting tests/test_api.py ____________________________________________________
ImportError while importing test module '/home/lightfm/tests/test_api.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
lightfm/lightfm/__init__.py:2: in <module>
__LIGHTFM_SETUP__
E NameError: name '__LIGHTFM_SETUP__' is not defined
During handling of the above exception, another exception occurred:
lightfm/lightfm/_lightfm_fast.py:3: in <module>
from ._lightfm_fast_openmp import * # NOQA
E ModuleNotFoundError: No module named 'lightfm._lightfm_fast_openmp'
During handling of the above exception, another exception occurred:
lightfm/tests/test_api.py:7: in <module>
from lightfm.lightfm import LightFM
lightfm/lightfm/__init__.py:4: in <module>
from .lightfm import LightFM
lightfm/lightfm/lightfm.py:8: in <module>
from ._lightfm_fast import (
lightfm/lightfm/_lightfm_fast.py:14: in <module>
from ._lightfm_fast_no_openmp import * # NOQA
E ModuleNotFoundError: No module named 'lightfm._lightfm_fast_no_openmp'
============================================================= warnings summary =============================================================
lightfm/lightfm/_lightfm_fast.py:10
/home/lightfm/lightfm/_lightfm_fast.py:10: UserWarning: LightFM was compiled without OpenMP support. Only a single thread will be used.
"LightFM was compiled without OpenMP support. "
-- Docs: https://docs.pytest.org/en/latest/warnings.html
========================================================= short test summary info ==========================================================
ERROR lightfm/tests/test_api.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================= 1 warning, 1 error in 0.39s ========================================================
docker-compose build lightfm
log
~/Desktop/lightfm docker-compose build lightfm Building lightfm Step 1/10 : FROM ubuntu:16.04 ---> c522ac0d6194 Step 2/10 : RUN apt-get update ---> Using cache ---> b64441cabfa6 Step 3/10 : RUN apt-get install -y libxml2 libxslt-dev wget bzip2 gcc ---> Using cache ---> 34e05995837b Step 4/10 : RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && /bin/bash ~/miniconda.sh -b -p /opt/conda && rm ~/miniconda.sh ---> Using cache ---> ab459584d9f0 Step 5/10 : ENV PATH /opt/conda/bin:$PATH ---> Using cache ---> 2572771054cb Step 6/10 : RUN conda install pytest jupyter scikit-learn ---> Using cache ---> 617daf37b1f1 Step 7/10 : ENV PYTHONDONTWRITEBYTECODE 1 ---> Using cache ---> 884626f7f728 Step 8/10 : ADD . /home/lightfm/ ---> 3ffc2c90de13 Step 9/10 : WORKDIR /home/ ---> Running in 8158241109ab Removing intermediate container 8158241109ab ---> 0f9fe63d6dd5 Step 10/10 : RUN cd lightfm && pip install -e . ---> Running in fd5cd5862536 Obtaining file:///home/lightfm Requirement already satisfied: numpy in /opt/conda/lib/python3.7/site-packages (from lightfm==1.15) (1.18.5) Requirement already satisfied: scipy>=0.17.0 in /opt/conda/lib/python3.7/site-packages (from lightfm==1.15) (1.5.0) Requirement already satisfied: requests in /opt/conda/lib/python3.7/site-packages (from lightfm==1.15) (2.23.0) Requirement already satisfied: scikit-learn in /opt/conda/lib/python3.7/site-packages (from lightfm==1.15) (0.23.1) Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.7/site-packages (from requests->lightfm==1.15) (2020.6.20) Requirement already satisfied: chardet=3.0.2 in /opt/conda/lib/python3.7/site-packages (from requests->lightfm==1.15) (3.0.4) Requirement already satisfied: idna=2.5 in /opt/conda/lib/python3.7/site-packages (from requests->lightfm==1.15) (2.9) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,=1.21.1 in /opt/conda/lib/python3.7/site-packages (from requests->lightfm==1.15) (1.25.8) Requirement already satisfied: joblib>=0.11 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->lightfm==1.15) (0.16.0) Requirement already satisfied: threadpoolctl>=2.0.0 in /opt/conda/lib/python3.7/site-packages (from scikit-learn->lightfm==1.15) (2.1.0) Installing collected packages: lightfm Running setup.py develop for lightfm Successfully installed lightfm Removing intermediate container fd5cd5862536 ---> 3ed973884559 Successfully built 3ed973884559 Successfully tagged lightfm_lightfm:latest ~/Desktop/lightfm
macOS Catalina 10.15.5 (19F101) Macbook Pro 16-inch (A2141) Docker 2.3.0.3 (45519)
Same issue here, both on MacOS M1 and on Ubuntu 20.04. Tried above recommendation without success.
were you able to resolve the issue?
were you able to resolve the issue?
no, I just gave up