2021年3月5日星期五

fail install pandas in python in docker

I've been trying to get a docker file running for three days now, but keep failing to install pandas.

Here you can see my Dockerfile

# pull official base image  FROM python:3.6.5-alpine    # set work directory  WORKDIR /usr/src/app    # set environment variables  ENV PYTHONDONTWRITEBYTECODE 1  ENV PYTHONUNBUFFERED 1    RUN apk update  RUN apk add postgresql-dev cargo gcc python3-dev libffi-dev musl-dev zlib-dev jpeg-dev #--(5.2)    COPY . /usr/src/app/  # install dependencies  RUN pip install --upgrade pip  RUN pip install -r requirements.txt  

and my requirement.txt is

wheel==0.36.2  asgiref==3.2.10  backcall==0.2.0  beautifulsoup4==4.9.1  certifi==2020.6.20  chardet==3.0.4  colorama==0.4.3  Cython==0.29.22  decorator==4.4.2  defusedxml==0.6.0  Django==3.1.6  django-allauth==0.42.0  django-crispy-forms==1.9.2  django-extensions==3.0.9  django-markdownx==3.0.1  et-xmlfile==1.0.1  gunicorn==20.0.4  idna==2.10  importlib-metadata==2.0.0  ipython  ipython-genutils==0.2.0  jdcal==1.4.1  jedi==0.17.2  Markdown==3.2.2  numpy  oauthlib==3.1.0  openpyxl==3.0.6  parso==0.7.1  pickleshare==0.7.5  Pillow==7.2.0  prompt-toolkit==3.0.7  psycopg2==2.8.6  pycparser==2.20  Pygments==2.7.1  python-dateutil==2.8.1  python3-openid==3.2.0  pytz==2020.1  requests==2.24.0  requests-oauthlib==1.3.0  semantic-version==2.8.5  setuptools-rust==0.11.6  six==1.15.0  soupsieve==2.0.1  sqlparse==0.3.1  toml==0.10.2  traitlets  urllib3==1.25.10  wcwidth==0.2.5  zipp==3.2.0  

i'm trying python 3.6.5, 3.7, 3.8, 3.8.5 but it can't install pandas requirement already satisfied but the wheel says,

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -DNPY_NO_DEPRECATED_API=0 -Ipandas/_libs/window -I./pandas/_libs -I/tmp/pip-build-env-e3sdep4m/overlay/lib/python3.7/site-packages/numpy/core/include -I/usr/local/include/python3.7m -c pandas/_libs/window/aggregations.cpp -o build/temp.linux-x86_64-3.7/pandas/_libs/window/aggregations.o

gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory command gcc failed with exit status 1 "failed building wheel for pandas pep517 err

so i use pip install --no-use-pep517 pandas

but it is not working same error is shown

how can i install pandas in python??

https://stackoverflow.com/questions/66502254/fail-install-pandas-in-python-in-docker March 06, 2021 at 12:07PM

没有评论:

发表评论