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

Google Colab: sleap and scipy issues #2100

Open
ajuavinett opened this issue Jan 29, 2025 · 2 comments
Open

Google Colab: sleap and scipy issues #2100

ajuavinett opened this issue Jan 29, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@ajuavinett
Copy link

Bug description

Colab cannot install sleap, this appears to be an issue with scipy, which will also not install in a Colab environment.

Expected behaviour

After running the following in Colab...

!pip uninstall -y opencv-python opencv-contrib-python
!pip install "sleap[pypi]>=1.3.3"

... I expected sleap to be installed and usable! :) Similarly, after running !pip install scipy==1.9.0 (or other versions) I expect scipy to be installed.

Actual behaviour

After trying sleap install, I receive the following message (after other dependencies successfully install as needed):

Collecting scipy<=1.9.0,>=1.4.1 (from sleap[pypi]>=1.3.3)
  Using cached scipy-1.9.0.tar.gz (42.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

After trying scipy install, I receive a similar message.

Your personal set up

This is in Colab, which currently ships with Python 3.11.11.

How to reproduce

Run

!pip uninstall -y opencv-python opencv-contrib-python
!pip install "sleap[pypi]>=1.3.3"

or

!pip uninstall -y opencv-python opencv-contrib-python
!pip install "sleap[pypi]>=1.4.1"

or

!pip install scipy==1.9.0

in a new Colab notebook.

@ajuavinett ajuavinett added the bug Something isn't working label Jan 29, 2025
@gitttt-1234
Copy link
Contributor

Hi @ajuavinett!

Colab recently updated their python to 3.11 which requires scipy > 1.9. However, for our package we use python 3.7.12 which supports scipy <= 1.9 (we pinned the version to resolve dependency conflicts). We could get past the scipy dependency however, there would again be a conflict with tensorflow with the latest python version. You could try creating a virtual env in colab with python v3.7.12 (it's a bit tricky but might work)

Thanks,

Divya

@ajuavinett
Copy link
Author

Thank you! Okay, so I was able to install a virtual environment for Python 3.7 in Colab using the following:

# Install venv if it's not already installed
!sudo apt-get update -y
!sudo apt-get install python3.7-venv 

# Create a virtual environment named 'my_sleap_env'
!python3.7 -m venv my_sleap_env 

# Activate the virtual environment
!source my_sleap_env/bin/activate 

# Install sleap
!pip install sleap[pypi]==1.4.1

This works for getting past issue with scipy and many other packages install just fine. However, now I'm receiving a error: legacy-install-failure with python-rapidjson. I'm wondering if you could think of any way around this?

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