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

Failed to install numba>=0.51.0 (from librosa) #834

Open
aegiff opened this issue Mar 27, 2023 · 8 comments · May be fixed by #1057
Open

Failed to install numba>=0.51.0 (from librosa) #834

aegiff opened this issue Mar 27, 2023 · 8 comments · May be fixed by #1057

Comments

@aegiff
Copy link

aegiff commented Mar 27, 2023

Failed to install numba>=0.51.0 from https://files.pythonhosted.org/packages/e2/1e/de917b683bb5f0b6078fb1397293eab84c4eaa825fbf94d73d6488eb354f/numba-0.56.4.tar.gz#sha256=32d9fef412c81483d7efe0ceb6cf4d3310fde8b624a9cecca00f790573ac96ee (from librosa).

Error when trying to install Librosa. Installing Numba standalone works fine, but Librosa fails to install.

Chaquopy version

id 'com.chaquo.python' version '14.0.2' apply false

Relevant parts of your build.gradle file

ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }
python {
            pip {
                install "librosa"
            }
        }

Describe your issue

> Task :app:generateDebugPythonRequirements
Chaquopy: Installing for arm64-v8a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-7.0, https://chaquo.com/pypi-13.1
Collecting librosa
  Using cached librosa-0.10.0.post2-py3-none-any.whl (253 kB)
Collecting joblib>=0.14
  Using cached joblib-1.2.0-py3-none-any.whl (297 kB)
Collecting lazy-loader>=0.1
  Using cached lazy_loader-0.2-py3-none-any.whl (8.6 kB)
Collecting decorator>=4.3.0
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting numpy!=1.22.0,!=1.22.1,!=1.22.2,>=1.20.3
  Using cached numpy-1.24.2.tar.gz (10.9 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting soundfile>=0.12.1
  Using cached soundfile-0.12.1-py2.py3-none-any.whl (24 kB)
Collecting soxr>=0.3.2
  Using cached soxr-0.3.4.tar.gz (288 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting scikit-learn>=0.20.0
  Using cached https://chaquo.com/pypi-7.0/scikit-learn/scikit_learn-0.24.1-0-cp38-cp38-android_21_arm64_v8a.whl (8.5 MB)
Processing c:\users\user\appdata\local\chaquopy\pip\cache\wheels\65\a0\3a\81dd01fbb92e18632a164800f949cb942cc1ab6e4138147321\msgpack-1.0.5-cp38-cp38-win_amd64.whl
Collecting numba>=0.51.0
  Using cached numba-0.56.4.tar.gz (2.4 MB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe' -S -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-492kmhmw\\numba\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-492kmhmw\\numba\\setup.py'"'"';import chaquopy_monkey; chaquopy_monkey.disable_native();f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --no-user-cfg egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\pip-pip-egg-info-6k_6fxjh'
         cwd: C:\Users\user\AppData\Local\Temp\pip-install-492kmhmw\numba\
    Complete output (80 lines):
    Running from numpy source directory.
    C:\Users\user\AppData\Local\Temp\easy_install-0quz8wsy\numpy-1.23.5\setup.py:86: DeprecationWarning:
    
      `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
      of the deprecation of `distutils` itself. It will be removed for
      Python >= 3.12. For older Python versions it will remain present.
      It is recommended to use `setuptools < 60.0` for those Python versions.
      For more details, see:
        https://numpy.org/devdocs/reference/distutils_status_migration.html
    
    
      import numpy.distutils.command.sdist
    Traceback (most recent call last):
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 250, in run_setup
    ERROR: Command errored out with exit status 1:

        _execfile(setup_script, ns)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\user\AppData\Local\Temp\easy_install-0quz8wsy\numpy-1.23.5\setup.py", line 102, in <module>
        else:
    TypeError: get_cmdclass() takes 0 positional arguments but 1 was given
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user\AppData\Local\Temp\pip-install-492kmhmw\numba\setup.py", line 431, in <module>
        setup(**metadata)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\dist.py", line 717, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\pkg_resources\__init__.py", line 782, in resolve
        dist = best[req.key] = env.best_match(
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\pkg_resources\__init__.py", line 1067, in best_match
        return self.obtain(req, installer)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\pkg_resources\__init__.py", line 1079, in obtain
        return installer(requirement)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\dist.py", line 787, in fetch_build_egg
        return cmd.easy_install(req)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\command\easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\command\easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\command\easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\command\easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\command\easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 253, in run_setup
        raise
      File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\_vendor\six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "C:\Users\user\Documents\GitHub\komet-android\app\build\generated\python/bp\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\user\AppData\Local\Temp\easy_install-0quz8wsy\numpy-1.23.5\setup.py", line 102, in <module>
        else:
    TypeError: get_cmdclass() takes 0 positional arguments but 1 was given
    ----------------------------------------
ERROR: Failed to install numba>=0.51.0 from https://files.pythonhosted.org/packages/e2/1e/de917b683bb5f0b6078fb1397293eab84c4eaa825fbf94d73d6488eb354f/numba-0.56.4.tar.gz#sha256=32d9fef412c81483d7efe0ceb6cf4d3310fde8b624a9cecca00f790573ac96ee (from librosa).
For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Failed to install numba>=0.51.0 from https://files.pythonhosted.org/packages/e2/1e/de917b683bb5f0b6078fb1397293eab84c4eaa825fbf94d73d6488eb354f/numba-0.56.4.tar.gz#sha256=32d9fef412c81483d7efe0ceb6cf4d3310fde8b624a9cecca00f790573ac96ee (from librosa).

Chaquopy: Exit status 1
@mhsmith mhsmith changed the title Failed to install numba error when trying to install librosa Failed to install numba>=0.51.0 Mar 27, 2023
@mhsmith
Copy link
Member

mhsmith commented Mar 27, 2023

We don't have a new enough version of numba to support the current version of librosa, but you can use an older one by changing the pip section of your build.gradle file as follows:

                install "librosa==0.9.2"
                install "resampy==0.3.1"

If anyone else needs a newer version of numba, please click the thumbs up button above, and post a comment explaining why you need it.

@realzzq
Copy link

realzzq commented May 3, 2024

[Moved to #1154]

@jareenanjom
Copy link

jareenanjom commented May 23, 2024

code was working fine with other pip libraries, as soon as i use librosa, it doesnt work anymore

> plugins {
>     id 'com.android.application'
>     id("com.chaquo.python")
> }
> 
> android {
>     namespace 'app.authentitk.footpathdetection'
>     compileSdk 34
> 
>     defaultConfig {
>         applicationId "app.authentitk.footpathdetection"
>         minSdk 27
>         targetSdk 33
>         versionCode 1
>         versionName "1.0"
> 
> 
>         ndk {
>             // On Apple silicon, you can omit x86_64.
>             abiFilters "arm64-v8a", "x86", "x86_64"
>         }
> 
> 
>         python {
>             version "3.8"
>             buildPython("C:/Users/zaree/anaconda3/python.exe")
>         }
> 
> 
> 
>         sourceSets {
>             main {
>                 python.srcDir "src/main/python"
>             }
>         }
> 
>         python{
>             pip{
>                 install "numpy"
>                 install "tflite-runtime"
>                 install "opencv-python"
>                 install "Pillow"
>                 install "librosa==0.9.2"
>                 install "resampy==0.3.1"
>             }
>         }
> 
>         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
>     }
> 
>     buildTypes {
>         release {
>             minifyEnabled false
>             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
>         }
>     }
>     compileOptions {
>         sourceCompatibility JavaVersion.VERSION_1_8
>         targetCompatibility JavaVersion.VERSION_1_8
>     }
>     buildFeatures {
>         mlModelBinding true
>     }
> }
> 
> dependencies {
> 
>     implementation 'androidx.appcompat:appcompat:1.6.1'
>     implementation 'com.google.android.material:material:1.11.0'
>     implementation 'org.tensorflow:tensorflow-lite:2.15.0'
>     implementation 'org.tensorflow:tensorflow-lite-support:0.4.4'
>     implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
>     implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
>     implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'
>     testImplementation 'junit:junit:4.13.2'
>     androidTestImplementation 'androidx.test.ext:junit:1.1.5'
>     androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
>     implementation 'com.google.mediapipe:tasks-vision:0.20230731'
> }

@mhsmith mhsmith changed the title Failed to install numba>=0.51.0 Failed to install numba>=0.51.0 (from librosa) May 24, 2024
@mhsmith
Copy link
Member

mhsmith commented May 24, 2024

@jareenanjom: See my comment above for a workaround.

@jmerkel11
Copy link

@mhsmith: I would also need a newer Numba for a newer Librosa. The newer Librosa fixes some bugs and adds some features in beatdetection. The newer Numba should please also support a newer Python. Python 3.8 will be end of life in 3 month.

@mhsmith
Copy link
Member

mhsmith commented Jul 20, 2024

I've decided that maintaining our own separate Android package repository isn't sustainable, so my plan is to work with upstream package developers to help them release their own Android wheels on PyPI. This will likely begin with Python 3.13, which is the first Python version with official Android support.

I'll post another comment here when I have any updates on this package.

@jmerkel11
Copy link

Do you already have more precise information on the time horizon?
Python 3.13 is currently a release candidate and the stable is expected to be released next month (correctly?).
Is it already possible to use Python 3.13 on android? And will it still be integrated via the chaquopy gradle plugin?
Would it be helpful if I open tickets in librosas and numbas issue tracker? Or are you already in contact with them?

@mhsmith
Copy link
Member

mhsmith commented Sep 12, 2024

We will make a new release of Chaquopy next month to add Python 3.13 support. However, Numba won't be one of the initially-supported packages, as it's relatively difficult to build. Both myself and the Numba maintainers now work for Anaconda, so we'll hopefully be able to resolve that later in the year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants