【问题标题】:GDAL will not install into a GitHub Actions Ubuntu venvGDAL 不会安装到 GitHub Actions Ubuntu venv
【发布时间】:2021-09-16 13:12:21
【问题描述】:

我的 .yml 代码如下所示,用于测试为 Git 上的存储库创建的每个拉取请求。

  name: Python Linux application
  
  on:
    pull_request:
      branches: [ '**' ]
  
  jobs:
    build:
  
      runs-on: ubuntu-latest
  
      steps:
        - uses: actions/checkout@v2
        - name: Set up Python 3.9
          uses: actions/setup-python@v2
          with:
            python-version: 3.9
        - name: Install dependencies
          run: |
            python -m pip install --upgrade pip
            sudo apt-get install libproj-dev proj-data proj-bin
            sudo apt-get install libgeos-dev
            sudo apt-get install gdal-bin libgdal-dev libgdal-doc
            pip install wheel
            pip install flake8 pytest Cython numpy proj geos GDAL==3.2.3
            if [ -f requirements-linux.txt ]; then pip install -r requirements-linux.txt; fi
        - name: Lint with flake8
          run: |
            # stop the build if there are Python syntax errors or undefined names
            flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
            # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
            flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
        - name: Test with pytest
          run: |
            pytest

经过几千 (11390) 行错误代码,这是最终的错误:

error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/hostedtoolcache/Python/3.9.5/x64/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rkrb3fqi/gdal_c6b10766da894ef6b4738e8ab6e2acd7/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rkrb3fqi/gdal_c6b10766da894ef6b4738e8ab6e2acd7/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-9qjem06l/install-record.txt --single-version-externally-managed --compile --install-headers /opt/hostedtoolcache/Python/3.9.5/x64/include/python3.9/GDAL Check the logs for full command output.

我已经尝试安装所有我能找到的与 GDAL 相关的标头,但似乎没有任何效果。

【问题讨论】:

    标签: ubuntu github pip gdal


    【解决方案1】:

    已修复,对于那些处于类似情况的人来说,这是此问题的答案:

          sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
          sudo apt-get update
          sudo apt-get install gdal-bin libgdal-dev
          pip install GDAL==3.2.3
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-30
      • 1970-01-01
      • 2020-08-15
      相关资源
      最近更新 更多