Python:运行Python脚本时出错

Python:运行Python脚本时出错,python,docker,numpy,alpine,Python,Docker,Numpy,Alpine,我在运行python脚本时遇到此错误,我在Linux Alpine docker中有python设置,我使用的是python 2.7,错误是: ImportError: C extension: umpy.core.multiarray failed to import not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext

我在运行python脚本时遇到此错误,我在Linux Alpine docker中有python设置,我使用的是python 2.7,错误是:

ImportError: C extension: umpy.core.multiarray failed to import not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.

我的环境有numpy=1.12.1。

似乎与相同的问题。您可以通过谷歌搜索错误消息来找到这些答案


看起来你的numpy版本的轮子坏了。能否安装更新版本的numpy?

您是在构建自己的docker映像,还是在使用现有映像?如果是前者,请包括Dockerfile的内容。如果是后者,请说明图像的名称和标记。我解决了运行此命令的问题。apk add——无缓存——虚拟。构建deps g++python开发libffi dev openssl-dev。然后我更新了numpy。