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

Can't install sample rate in google colab #15

Open
ajayarora1235 opened this issue Feb 16, 2024 · 4 comments
Open

Can't install sample rate in google colab #15

ajayarora1235 opened this issue Feb 16, 2024 · 4 comments
Assignees

Comments

@ajayarora1235
Copy link

ajayarora1235 commented Feb 16, 2024

Version of python is 3.10.12.

!pip install samplerate --no-cache-dir returns

Collecting samplerate
  Downloading samplerate-0.2.1.tar.gz (21 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from samplerate) (1.25.2)
Building wheels for collected packages: samplerate
  error: subprocess-exited-with-error
  
  × Building wheel for samplerate (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.
  Building wheel for samplerate (pyproject.toml) ... error
  ERROR: Failed building wheel for samplerate
Failed to build samplerate
ERROR: Could not build wheels for samplerate, which is required to install pyproject.toml-based projects

Can't get any of the errors to display, but it also fails for me on my mac locally. seemed to be an issue there with cmake and "from cmake import cmake".

@fakufaku
Copy link
Collaborator

Hi @ajayarora1235 , actually, I had the same issue on colab, and I think I know the cause.
samplerate uses cmake to handle the compilation. Colab comes with the cmake python package (a wrapper around) cmake preinstalled, so that calling cmake calls this package instead of the real cmake.
However, the python package build system creates an empty environment to build the package, and there, the cmake python is not available, however, it still calls the same cmake wrapper that depends on it.
The solution is to add the cmake python wrapper as a build dependency of samplerate.
I will try to do that quickly.

@fakufaku
Copy link
Collaborator

I made a fix in PR #16 . You can try it by installing from the fix_cmake_dep branch. I have verified successful installation of the package on colab with the following command.

pip -q install git+https://github.com/tuxu/python-samplerate.git@fix_cmake_dep

@fakufaku fakufaku self-assigned this Feb 17, 2024
@kieranabrennan
Copy link

Thanks for this fix! I came across the same problem today and this fixed it for me

@Pbotsaris
Copy link

same here, thanks for the fix.

33646341 added a commit to 33646341/fish-speech that referenced this issue May 10, 2024
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

4 participants