GithubHelp home page GithubHelp logo

Docker Build Fails Tests about lightfm HOT 4 CLOSED

lyst avatar lyst commented on July 19, 2024
Docker Build Fails Tests

from lightfm.

Comments (4)

maciejkula avatar maciejkula commented on July 19, 2024

Have you built the extension? Can you try running it from a different
directory?

On 15 Jul 2016 16:30, "Sean M. Law, Ph.D." [email protected] wrote:

Following the issue #101 #101, I
tried running the test as per the Docs:

docker-compose run lightfm py.test -x tests/

And then I ran it from the Docker shell (see below). In both cases, the
test fails to find lightfm_fast

root@002ca3eaa9c1:/home/lightfm# py.test -x tests/
================================================== test session starts ==================================================
platform linux2 -- Python 2.7.9, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/lightfm, inifile:
collecting 0 items / 1 errors
======================================================== ERRORS =========================================================
__________________________________________ ERROR collecting tests/test_api.py ___________________________________________
tests/test_api.py:7: in
from lightfm import LightFM
lightfm/init.py:1: in
from .lightfm import LightFM
lightfm/lightfm.py:9: in
from .lightfm_fast import (CSRMatrix, FastLightFM,
E ImportError: No module named lightfm_fast
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================ 1 error in 0.30 seconds ================================================


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#103, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACSCA-6VZbMegYU0Yr4YZLJwcmv2TV7Zks5qV5logaJpZM4JNc_-
.

from lightfm.

seanlaw avatar seanlaw commented on July 19, 2024

No, I had not built the extension and noticed that Cython is not in the Dockerfile as well.

Then, I did the following:

pip uninstall lightfm
cd /home/lightfm
apt-get install -y cython
python setup.py cythonize
ls lightfm

This shows that the extension is present (the lightfm_fast.pyx file). And then I install lightfm and ran the test again:

pip install .
py.test -x tests/

This results in the same error as my original post. As per the document:

If you’d like to use the multi-threading capabilities of LightFM on these platforms, you should try using it via Docker as described in the next secion.

My goal is to be able to get multi-threading working on my Macbook Pro via Docker.

from lightfm.

maciejkula avatar maciejkula commented on July 19, 2024

Off the top of my head:

  1. Cython does not need to be in the container.
  2. You do not need to run cythonize.
  3. When the container is built lightfm is already installed.
  4. When you run tests they fail because pytest picks up the source code
    from the directory you are running the tests in instead of the installed
    package. You must move the tests somewhere else or run them or run pip
    install -e .

On 16 Jul 2016 12:59 pm, "Sean M. Law, Ph.D." [email protected]
wrote:

No, I had not built the extension and noticed that Cython is not in the
Dockerfile as well.

Then, I did the following:

pip uninstall lightfm
cd /home/lightfm
apt-get install -y cython
python setup.py cythonize
ls lightfm

This shows that the extension is present (the lightfm_fast.pyx file). And
then I install lightfm and ran the test again:

pip install .
py.test -x tests/

This results in the same error as my original post.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#103 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACSCA8k-w2u3XdZjP3d4HJLnAEj5AlT9ks5qWLl-gaJpZM4JNc_-
.

from lightfm.

maciejkula avatar maciejkula commented on July 19, 2024

I just verified that after adding the libblas fixes lightfm is correctly
installed in the docker container.

You can check this by deleting the lightfm folder from the mounted
repository folder. This will prevent python from picking up the local files
(which do not have the extension built) in the import process, and tests
will complete.

On 16 Jul 2016 1:13 pm, "Maciej Kula" [email protected] wrote:

Off the top of my head:

  1. Cython does not need to be in the container.
  2. You do not need to run cythonize.
  3. When the container is built lightfm is already installed.
  4. When you run tests they fail because pytest picks up the source code
    from the directory you are running the tests in instead of the installed
    package. You must move the tests somewhere else or run them or run pip
    install -e .

On 16 Jul 2016 12:59 pm, "Sean M. Law, Ph.D." [email protected]
wrote:

No, I had not built the extension and noticed that Cython is not in the
Dockerfile as well.

Then, I did the following:

pip uninstall lightfm
cd /home/lightfm
apt-get install -y cython
python setup.py cythonize
ls lightfm

This shows that the extension is present (the lightfm_fast.pyx file). And
then I install lightfm and ran the test again:

pip install .
py.test -x tests/

This results in the same error as my original post.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#103 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACSCA8k-w2u3XdZjP3d4HJLnAEj5AlT9ks5qWLl-gaJpZM4JNc_-
.

from lightfm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.