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

pomegranate on Colab #388

Closed
leehart opened this issue Apr 21, 2023 · 2 comments
Closed

pomegranate on Colab #388

leehart opened this issue Apr 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@leehart
Copy link
Collaborator

leehart commented Apr 21, 2023

Reported by @korlevic

On Google Colab with Python 3.9.16, installing the default version of pomegranate via !pip install (for functions such as plot_roh) currently results in pomegranate v1.0.0, which no longer has HiddenMarkovModel, so the current plot_roh function fails, due to "ImportError: cannot import name 'HiddenMarkovModel' from 'pomegranate'".

Whereas installing v0.14.8 of pomegranate on Colab, via !pip install pomegranate==0.14.8, currently fails after import pomegranate due to:

RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .

Followed by:

ImportError: numpy.core.multiarray failed to import

@leehart leehart added the bug Something isn't working label Apr 21, 2023
@alimanfoo
Copy link
Member

This is the underlying problem when trying to install pomegranage v0.14.8 - pypa/pip#9542

A workaround is to disable build isolation, which forces pomegranate to be compiled within the some Python environment that it's going to be used in. In this case, all build dependencies are already installed on colab, so this should be all that's needed:

!pip install --no-build-isolation pomegranate==0.14.8

@alimanfoo
Copy link
Member

Suggest we close this issue as there is a workaround. There is a larger piece of work though to upgrade to pomegranate 1.0. That is probably something for upstream libraries, either scikit-allel or sgkit.

@leehart leehart closed this as completed Apr 27, 2023
@leehart leehart closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants