1

I'm deploying a Rasa chatbot on Heroku from Mac M1. No error of package incompatibility. successfully push to Heroku. Everytime i tried to run Rasa worker, it gives me this error in the log:

ImportError: numpy.core.multiarray failed to import

My app requires 1.16.5<= numpy <1.19. I have tried and have no success with these versions: 1.18.5, 1.18.4, 1.18.3, 1.18.2

I copied the log below. Does anyone know how to handle this error or recommend a numpy version that works?

Please help, i have stuck on this for days.

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
2021-07-28T20:44:18.990990+00:00 app[worker.1]: Traceback (most recent call last):
2021-07-28T20:44:18.991691+00:00 app[worker.1]: File "/app/.heroku/python/bin/rasa", line 8, in <module>
2021-07-28T20:44:18.992064+00:00 app[worker.1]: sys.exit(main())
2021-07-28T20:44:18.992104+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/__main__.py", line 117, in main
2021-07-28T20:44:18.992873+00:00 app[worker.1]: cmdline_arguments.func(cmdline_arguments)
2021-07-28T20:44:18.992903+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/cli/run.py", line 95, in run
2021-07-28T20:44:18.995099+00:00 app[worker.1]: rasa.run(**vars(args))
2021-07-28T20:44:18.995153+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/api.py", line 37, in run
2021-07-28T20:44:18.995487+00:00 app[worker.1]: import rasa.core.run
2021-07-28T20:44:18.995516+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/core/run.py", line 15, in <module>
2021-07-28T20:44:18.995855+00:00 app[worker.1]: from rasa import model, server, telemetry
2021-07-28T20:44:18.995888+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/server.py", line 57, in <module>
2021-07-28T20:44:18.996236+00:00 app[worker.1]: from rasa.core.agent import Agent
2021-07-28T20:44:18.996265+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/core/agent.py", line 31, in <module>
2021-07-28T20:44:18.996565+00:00 app[worker.1]: from rasa.core.policies.ensemble import PolicyEnsemble, SimplePolicyEnsemble
2021-07-28T20:44:18.996594+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/core/policies/__init__.py", line 5, in <module>
2021-07-28T20:44:18.996869+00:00 app[worker.1]: from rasa.core.policies.ensemble import (  # noqa: F401
2021-07-28T20:44:18.997047+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/core/policies/ensemble.py", line 46, in <module>
2021-07-28T20:44:18.997616+00:00 app[worker.1]: from rasa.core.policies.rule_policy import RulePolicy
2021-07-28T20:44:18.997697+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/core/policies/rule_policy.py", line 49, in <module>
2021-07-28T20:44:18.998526+00:00 app[worker.1]: import rasa.core.test
2021-07-28T20:44:18.998558+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/core/test.py", line 10, in <module>
2021-07-28T20:44:18.998764+00:00 app[worker.1]: from rasa.nlu.test import EntityEvaluationResult, evaluate_entities
2021-07-28T20:44:18.998793+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/nlu/test.py", line 24, in <module>
2021-07-28T20:44:18.999250+00:00 app[worker.1]: import rasa.utils.plotting as plot_utils
2021-07-28T20:44:18.999280+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/rasa/utils/plotting.py", line 9, in <module>
2021-07-28T20:44:19.000025+00:00 app[worker.1]: from matplotlib.ticker import FormatStrFormatter
2021-07-28T20:44:19.000055+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/matplotlib/ticker.py", line 174, in <module>
2021-07-28T20:44:19.000437+00:00 app[worker.1]: from matplotlib import transforms as mtransforms
2021-07-28T20:44:19.000468+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/matplotlib/transforms.py", line 43, in <module>
2021-07-28T20:44:19.000906+00:00 app[worker.1]: from matplotlib._path import (
2021-07-28T20:44:19.001002+00:00 app[worker.1]: ImportError: numpy.core.multiarray failed to import
holabello
  • 11
  • 1

2 Answers2

0

According to your error logs, not the proper numpy version is used in runtime.

Try to upgrade numpy with pip install numpy --upgrade.

czeni
  • 427
  • 2
  • 11
  • How do you pip install on Heroku? I currently have to specify the numpy version in requirements.txt file – holabello Jul 29 '21 at 05:24
0

Upgrade higher version of Marplotlib solve the error. It wasn't numpy.

holabello
  • 11
  • 1