简体   繁体   中英

Error with librosa library in deploying to heroku server

I try to deploy python code to Heroku server and obtain the next error, associated as I think with librosa library:

2021-10-31T17:02:20.055394+00:00 app[bot.1]: import librosa
2021-10-31T17:02:20.055410+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.9/site-packages/librosa/__init__.py", line 211, in <module>
2021-10-31T17:02:20.055538+00:00 app[bot.1]: from . import core
2021-10-31T17:02:20.055547+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.9/site-packages/librosa/core/__init__.py", line 5, in <module>
2021-10-31T17:02:20.055612+00:00 app[bot.1]: from .convert import *  # pylint: disable=wildcard-import
2021-10-31T17:02:20.055620+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.9/site-packages/librosa/core/convert.py", line 7, in <module>
2021-10-31T17:02:20.055683+00:00 app[bot.1]: from . import notation
2021-10-31T17:02:20.055692+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.9/site-packages/librosa/core/notation.py", line 8, in <module>
2021-10-31T17:02:20.055770+00:00 app[bot.1]: from ..util.exceptions import ParameterError
2021-10-31T17:02:20.055778+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.9/site-packages/librosa/util/__init__.py", line 83, in <module>
2021-10-31T17:02:20.055862+00:00 app[bot.1]: from .utils import *  # pylint: disable=wildcard-import
2021-10-31T17:02:20.055871+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.9/site-packages/librosa/util/utils.py", line 10, in <module>
2021-10-31T17:02:20.055934+00:00 app[bot.1]: import numba
2021-10-31T17:02:20.055942+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.9/site-packages/numba/__init__.py", line 198, in <module>
2021-10-31T17:02:20.056029+00:00 app[bot.1]: _ensure_critical_deps()
2021-10-31T17:02:20.056038+00:00 app[bot.1]: File "/app/.heroku/python/lib/python3.9/site-packages/numba/__init__.py", line 138, in _ensure_critical_deps
2021-10-31T17:02:20.056131+00:00 app[bot.1]: raise ImportError("Numba needs NumPy 1.20 or less")
2021-10-31T17:02:20.056153+00:00 app[bot.1]: ImportError: Numba needs NumPy 1.20 or less

I freeze the dependencies in requirements.txt like this:

numba==0.54.1
numpy==1.19.5

But still faced with the same error

You need to install some dependencies via:

  1. Configure buildpacks

    FFMPEG to load audios and other things

    heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git

    APT buildpack for install dependencies via apt

     heroku buildpacks:add --index 2 heroku-community/apt
  2. Configure Aptfile

    Create an Aptfile and write the dependencies:

     libsndfile1 libsndfile-dev libasound2-dev

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM