簡體   English   中英

Gitlab Flask Page: Problems with installing python GDAL package for Frozen Flask Application with.gitlab-ci.yml file

[英]Gitlab Flask Page: Problems with installing python GDAL package for Frozen Flask Application with .gitlab-ci.yml file

我目前正在嘗試使用冷凍瓶將燒瓶應用程序上傳為 gitlab 頁面。 但是,當嘗試在服務器上設置所有內容時,管道會失敗。 My.gitlab-ci.yml 文件如下所示:

image: python:3.9.5

pages:
  before_script:
    - apt update && apt install -y libgdal-dev
  script:
  - pip install --upgrade pip
  - pip install --no-cache-dir -r requirements.txt
  - FLASK_APP=app.py flask freeze
  artifacts:
    paths:
    - public
  only:
  - master


requirements.txt 文件如下所示:

affine==2.3.0
beautifulsoup4==4.10.0
dask==2021.6.2
demessaging==0.1.3
Flask==1.1.2
Frozen_Flask==0.18
future==0.18.2
GDAL==3.3.0
geopandas==0.9.0
ipython==7.30.1
matplotlib==3.4.2
mlrose==1.3.0
networkx==2.3
numpy==1.21.0
osgeo==0.0.1
osr==0.0.1
pandas==1.2.5
Pillow==8.4.0
plotly==4.14.3
psyplot==1.3.1
pyhdf==0.10.3
pyproj==3.1.0
pysftp==0.2.9
python_dateutil==2.8.2
pytz==2021.1
rasterio==1.2.6
requests==2.25.1
rioxarray==0.6.1
salem==0.3.4
scikit_image==0.18.1
scikit_learn==1.0.1
scipy==1.7.0
Shapely==1.7.1
six==1.16.0
wradlib==1.2.1
xarray==0.18.2

失敗管道中的錯誤是指設置 GDAL package 的一些問題。 因此,腳本一直運行,直到它必須在環境中設置所有包,它在 package GDAL 處停止。 但是,這個錯誤很難弄清楚,因為它非常神秘。 我還沒有找到解決方法,因為我在應用程序中依賴 GDAL package,我希望你能幫助我。 在此先感謝:錯誤的結尾看起來像這樣(整個錯誤消息很大,我認為在這里沒有幫助):

                     from extensions/gdal_array_wrap.cpp:174:
    /usr/local/include/python3.9/ceval.h:130:37: note: declared here
     Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
                                         ^~~~~~~~~~~~~~~~~~
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wqrt2f9g/gdal_224acb310d654aeb97d659380ad0b7f2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wqrt2f9g/gdal_224acb310d654aeb97d659380ad0b7f2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-cgdjkbmo/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/GDAL Check the logs for full command output.
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

您需要安裝 gcc 以獲得所需的構建工具。 您可以通過安裝apt或安裝包含 gcc 和其他常見構建要求的build-essential元包來實現此gcc

image: python:3.9-slim
pages:
  before_script:
    - apt update && apt install -y build-essential libgdal-dev

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM