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

[BUG] Version 2.3.0 not working on Google Colab #655

Open
aymenkhs opened this issue Dec 28, 2024 · 1 comment
Open

[BUG] Version 2.3.0 not working on Google Colab #655

aymenkhs opened this issue Dec 28, 2024 · 1 comment

Comments

@aymenkhs
Copy link

Description

Import fails in Colab in latest version

In which platform does it happen?

Google Colab

How do we replicate the issue?

Install Cornac 2.3.0 using !pip install cornac==2.3.0 and import any part of the library.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[<ipython-input-2-2713bf83a8d2>](https://localhost:8080/#) in <cell line: 1>()
----> 1 import cornac

6 frames
[/usr/local/lib/python3.10/dist-packages/cornac/models/bpr/__init__.py](https://localhost:8080/#) in <module>
     14 # ============================================================================
     15 
---> 16 from .recom_bpr import BPR
     17 from .recom_wbpr import WBPR

ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /usr/local/lib/python3.10/dist-packages/cornac/models/bpr/recom_bpr.cpython-310-x86_64-linux-gnu.so)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Expected behavior

The import should work normally

Other Comments

The following notebook shows the error : Notebook link

@tqtg
Copy link
Member

tqtg commented Dec 28, 2024

This is very tricky because some models of Cornac complied using gcc13 where Google Colab env doesn't have required libs installed. So, the solution is as follows:

  1. Run the following to install latest libstdc++6:
!sudo add-apt-repository ppa:ubuntu-toolchain-r/test
!sudo apt-get update
!sudo apt-get install --only-upgrade libstdc++6
  1. Run the following and make sure you see GLIBCXX_3.4.32 in the output:
!strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
  1. Restart Colab (Runtime -> restart session)
  2. Try import cornac again and see if it works

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