gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

docker image error: No module named 'numpy.core._multiarray_umath'

Open mmorsy1981 opened this issue 1 year ago • 3 comments

Traceback (most recent call last): File "/usr/app/venv/lib/python3.11/site-packages/numpy/core/init.py", line 23, in from . import multiarray File "/usr/app/venv/lib/python3.11/site-packages/numpy/core/multiarray.py", line 10, in from . import overrides File "/usr/app/venv/lib/python3.11/site-packages/numpy/core/overrides.py", line 6, in from numpy.core._multiarray_umath import ( ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/app/venv/bin/streamlit", line 5, in from streamlit.web.cli import main File "/usr/app/venv/lib/python3.11/site-packages/streamlit/init.py", line 55, in from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator File "/usr/app/venv/lib/python3.11/site-packages/streamlit/delta_generator.py", line 36, in from streamlit import config, cursor, env_util, logger, runtime, type_util, util File "/usr/app/venv/lib/python3.11/site-packages/streamlit/cursor.py", line 18, in from streamlit.runtime.scriptrunner import get_script_run_ctx File "/usr/app/venv/lib/python3.11/site-packages/streamlit/runtime/init.py", line 16, in from streamlit.runtime.runtime import Runtime as Runtime File "/usr/app/venv/lib/python3.11/site-packages/streamlit/runtime/runtime.py", line 31, in from streamlit.runtime.app_session import AppSession File "/usr/app/venv/lib/python3.11/site-packages/streamlit/runtime/app_session.py", line 35, in from streamlit.runtime import caching, legacy_caching File "/usr/app/venv/lib/python3.11/site-packages/streamlit/runtime/caching/init.py", line 21, in from streamlit.runtime.caching.cache_data_api import ( File "/usr/app/venv/lib/python3.11/site-packages/streamlit/runtime/caching/cache_data_api.py", line 32, in from streamlit.runtime.caching.cache_errors import CacheError, CacheKeyNotFoundError File "/usr/app/venv/lib/python3.11/site-packages/streamlit/runtime/caching/cache_errors.py", line 18, in from streamlit import type_util File "/usr/app/venv/lib/python3.11/site-packages/streamlit/type_util.py", line 40, in import numpy as np File "/usr/app/venv/lib/python3.11/site-packages/numpy/init.py", line 141, in from . import core File "/usr/app/venv/lib/python3.11/site-packages/numpy/core/init.py", line 49, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.11 from "/usr/app/venv/bin/python"
  • The NumPy version is: "1.24.3"

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

mmorsy1981 avatar May 03 '23 19:05 mmorsy1981

Same issue here. Does anyone know a Git commit hash that works?

mabushey avatar May 03 '23 20:05 mabushey

@mabushey try this for now, it works:

git co cb17cc7fe41440c920082722ca6e5bf0bd3d75e8 && docker-compose up --build

chrislan815 avatar May 03 '23 21:05 chrislan815

As a stop gap you can edit your Dockerfile by changing from the alpine container and installing the dependencies.

TLDL replace the line 17 with this

FROM python:3.11

RUN pip install numpy && pip install setuptools

Heaven-Art avatar May 03 '23 22:05 Heaven-Art