如何在构建docker时解决python pandas导入错误

时间:2018-12-26 04:47:03

标签: python pandas docker docker-compose

嗨,我需要为我的python代码构建一个docker,而在运行docker时,我遇到如下所示的import pandas import错误

File "app.py", line 3, in <module>
import pandas as pd
File "/usr/local/lib/python3.6/dist-packages/pandas/__init__.py", line 7, in 
<module>
  from pandas import hashtable, tslib, lib
File "pandas/src/numpy.pxd", line 865, in init pandas.hashtable 
 (pandas/hashtable.c:38266)
ValueError: numpy.ufunc has the wrong size, try recompiling
rahuls-MacBook-Pro-2:date inndata$ docker build -t inndata/dates
"docker build" requires exactly 1 argument.
 See 'docker build --help'.

请帮助我诊断错误。

我的需求文件:-

numpy >= 1.1, < 2.0
pandas >= 0.13, < 0.22
nose >= 1.3.1, < 1.4
nolearn == 0.5b1
Flask == 1.0.2
pymongo ==  3.7.1
msgpack==0.5.6
spacy == 2.0.12

我的docker文件

FROM ubuntu:18.10
RUN apt-get update -y
RUN apt-get install -y python3 python3-dev python3-pip build-essential
RUN pip3 install uwsgi
RUN apt-get install vim -y
 COPY ./ ./app
WORKDIR ./app
RUN python3 -m pip install --upgrade pip
RUN pip3 install -r requirements.txt
ENTRYPOINT ["python3"]
CMD ["app.py"]

在app.py中,我有我的python代码。

0 个答案:

没有答案