我们在Django API服务中遇到了这个错误,其中ElasticSearch使用numpy作为依赖项。它已经正常工作了一年多,突然开始出错。我已经尝试了所有可能的解决方案,但似乎没有任何帮助。
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-
packages/elasticsearch/transport.py”, line 31, in <module>
from .serializer import DEFAULT_SERIALIZERS, Deserializer, JSONSerializer
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/elasticsearch/serializer.py”, line 35, in <module>
import numpy as np
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/numpy/__init__.py”, line 141, in <module>
from . import core
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/numpy/core/__init__.py”, line 23, in <module>
from . import multiarray
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/numpy/core/multiarray.py”, line 10, in <module>
from . import overrides
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/numpy/core/overrides.py”, line 6, in <module>
from numpy.core._multiarray_umath import (
KeyboardInterrupt
settings.INSTALLED_APPS
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/django/conf/__init__.py”, line 82, in __getattr__
self._setup(name)
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/django/conf/__init__.py”, line 69, in _setup
self._wrapped = Settings(settings_module)
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/django/conf/__init__.py”, line 170, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File “/usr/local/lib/python3.9/importlib/__init__.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “<frozen importlib._bootstrap>“, line 1030, in _gcd_import
File “<frozen importlib._bootstrap>“, line 1007, in _find_and_load
File “<frozen importlib._bootstrap>“, line 986, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>“, line 680, in _load_unlocked
File “<frozen importlib._bootstrap_external>“, line 850, in exec_module
File “<frozen importlib._bootstrap>“, line 228, in _call_with_frames_removed
File “/usr/src/REPLACED/REPLACED/settings.py”, line 15, in <module>
from elasticsearch import Elasticsearch, RequestsHttpConnection
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/elasticsearch/__init__.py”, line 36, in <module>
from .client import Elasticsearch
File “/root/.cache/pypoetry/virtualenvs/REPLACED-wGPJvZ3g-py3.9/lib/python3.9/site-packages/elasticsearch/client/__init__.py”, line 23, in <module>
from ..transport import Transport, TransportError
OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 4: Operation not permitted
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 2 of 4: Operation not permitted
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
OpenBLAS blas_thread_init: pthread_create failed for thread 3 of 4: Operation not permitted
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
相同的代码在本地和暂存环境上运行没有问题。
1条答案
按热度按时间y0u0uwnf1#
如果你使用的是debian基础镜像,试着使用alpine镜像。