Могу ли я повторно использовать зависимость, уже включенную в колесо другого пакета?
Эта проблема возникает в Linux (официальный образ докера python:3). В Windows я могу установить эти зависимости, потому что готовые колеса для всех библиотек найдены здесь .
Это проект GIS ML, требующий:
fiona
GDAL
rasterio
доступен только в исходном коде на PyPI. Для сборки требуется множество зависимостей.
- Как установить на Ubuntu 16.04: https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html , но это не поддерживает последнюю версию Ubuntu из-за
gdal-bin
зависимость недоступна для последней версии Ubuntu даже от ubuntugis или ubuntugis: unstable PPA - Пример сборки колес GDAL для многих Linux: https://github.com/youngpm/gdalmanylinux , но эти колеса не поддерживаются .
Проблема с этими методами заключается в том, что дистрибутив слишком стар и/или Python слишком стар. Я ищу образ докера python: 3 или хочу использовать Ubuntu 20.04 и python 3.9+.
зависит от GDAL и включил колесо на PyPI, так что можно установить!
зависит от GDAL, но не имеет колеса с включенным GDAL, поэтому пытается установить и его.
Итак, мой вопрос: могу ли я как-то повторно использовать колесо GDAL, упакованное для
rasterio
а также
GDAL
сам прямо ??Я попытался просто перечислить требования с помощью
fiona
сначала, но получить:
fiona
rasterio
#8 87.66 Collecting fiona
#8 87.76 Downloading Fiona-1.8.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB)
#8 89.95 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.6/16.6 MB 7.5 MB/s eta 0:00:00
#8 90.49 Collecting rasterio
#8 90.58 Downloading rasterio-1.2.10.tar.gz (2.3 MB)
#8 90.88 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 7.4 MB/s eta 0:00:00
#8 91.31 Installing build dependencies: started
#8 104.1 Installing build dependencies: finished with status 'done'
#8 104.1 Getting requirements to build wheel: started
#8 104.5 Getting requirements to build wheel: finished with status 'error'
#8 104.5 error: subprocess-exited-with-error
#8 104.5
#8 104.5 × Getting requirements to build wheel did not run successfully.
#8 104.5 │ exit code: 1
#8 104.5 ╰─> [2 lines of output]
#8 104.5 WARNING:root:Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'
#8 104.5 ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
#8 104.5 [end of output]
#8 104.5
#8 104.5 note: This error originates from a subprocess, and is likely not a problem with pip.
#8 104.5 error: subprocess-exited-with-error
#8 104.5
#8 104.5 × Getting requirements to build wheel did not run successfully.
#8 104.5 │ exit code: 1
#8 104.5 ╰─> See above for output.
#8 104.5
#8 104.5 note: This error originates from a subprocess, and is likely not a problem with pip.
fiona
GDAL
#8 88.72 Collecting fiona
#8 88.80 Downloading Fiona-1.8.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB)
#8 90.95 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.6/16.6 MB 7.6 MB/s eta 0:00:00
#8 91.35 Collecting GDAL
#8 91.43 Downloading GDAL-3.4.2.tar.gz (757 kB)
#8 91.54 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.6/757.6 KB 7.4 MB/s eta 0:00:00
#8 91.71 Preparing metadata (setup.py): started
#8 92.33 Preparing metadata (setup.py): finished with status 'error'
#8 92.35 error: subprocess-exited-with-error
#8 92.35
#8 92.35 × python setup.py egg_info did not run successfully.
#8 92.35 │ exit code: 1
#8 92.35 ╰─> [120 lines of output]
#8 92.35 WARNING: numpy not available! Array support will not be enabled
#8 92.35 running egg_info
#8 92.35 creating /tmp/pip-pip-egg-info-sypp33ni/GDAL.egg-info
#8 92.35 writing /tmp/pip-pip-egg-info-sypp33ni/GDAL.egg-info/PKG-INFO
#8 92.35 writing dependency_links to /tmp/pip-pip-egg-info-sypp33ni/GDAL.egg-info/dependency_links.txt
#8 92.35 writing requirements to /tmp/pip-pip-egg-info-sypp33ni/GDAL.egg-info/requires.txt
#8 92.35 writing top-level names to /tmp/pip-pip-egg-info-sypp33ni/GDAL.egg-info/top_level.txt
#8 92.35 writing manifest file '/tmp/pip-pip-egg-info-sypp33ni/GDAL.egg-info/SOURCES.txt'
#8 92.35 Traceback (most recent call last):
#8 92.35 File "/tmp/pip-install-807gd89_/gdal_1aa003cfc1164be49e92450709ba2b6e/setup.py", line 105, in fetch_config
#8 92.35 p = subprocess.Popen([command, args], stdout=subprocess.PIPE)
#8 92.35 File "/usr/local/lib/python3.10/subprocess.py", line 966, in __init__
#8 92.35 self._execute_child(args, executable, preexec_fn, close_fds,
#8 92.35 File "/usr/local/lib/python3.10/subprocess.py", line 1842, in _execute_child
#8 92.35 raise child_exception_type(errno_num, err_msg, err_filename)
#8 92.35 FileNotFoundError: [Errno 2] No such file or directory: '../../apps/gdal-config'
#8 92.35