#python #apple-m1 #netcdf4
#python #apple-m1 #netcdf4
Вопрос:
Я пытаюсь установить netcdf4-python на MacOSX Monterey с процессором M1.
Я без проблем установил hdf5 и netcdf с помощью brew.
Однако после клонирования репозитория netcfd4 python в https://github.com/Unidata/netcdf4-python , когда я затем пытаюсь установить netcdf4-python с python setup.py build
помощью, я получаю сообщение об ошибке ниже. Я немного погуглил, и кажется, что установка brew hdf5 не включена hdf5.pc
, поэтому мне интересно, нашел ли кто-нибудь способ обойти эту проблему.
Я использую python 3.9.9
Спасибо за вашу помощь
Марко
Collecting netcdf4
Using cached netCDF4-1.5.8.tar.gz (767 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/mpagani/.pyenv/versions/3.9.9/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j5/vpmn9x657d3gzwvrx2vryvc80000gn/T/pip-install-y1xv724i/netcdf4_95eb462bb7b74fdfbac8a5de4965d36b/setup.py'"'"'; __file__='"'"'/private/var/folders/j5/vpmn9x657d3gzwvrx2vryvc80000gn/T/pip-install-y1xv724i/netcdf4_95eb462bb7b74fdfbac8a5de4965d36b/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('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/j5/vpmn9x657d3gzwvrx2vryvc80000gn/T/pip-pip-egg-info-bbawe1ww
cwd: /private/var/folders/j5/vpmn9x657d3gzwvrx2vryvc80000gn/T/pip-install-y1xv724i/netcdf4_95eb462bb7b74fdfbac8a5de4965d36b/
Complete output (29 lines):
Package hdf5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `hdf5.pc'
to the PKG_CONFIG_PATH environment variable
No package 'hdf5' found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/j5/vpmn9x657d3gzwvrx2vryvc80000gn/T/pip-install-y1xv724i/netcdf4_95eb462bb7b74fdfbac8a5de4965d36b/setup.py", line 409, in <module>
_populate_hdf5_info(dirstosearch, inc_dirs, libs, lib_dirs)
File "/private/var/folders/j5/vpmn9x657d3gzwvrx2vryvc80000gn/T/pip-install-y1xv724i/netcdf4_95eb462bb7b74fdfbac8a5de4965d36b/setup.py", line 360, in _populate_hdf5_info
raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers
reading from setup.cfg...
using nc-config...
checking /opt/homebrew/Cellar/netcdf/4.8.1/include ...
hdf5 headers not found in /opt/homebrew/Cellar/netcdf/4.8.1/include
nc-config did provide path to HDF5 headers, search standard locations...
HDF5_DIR environment variable not set, checking some standard locations ..
checking /Users/mpagani/include ...
hdf5 headers not found in /Users/mpagani/include
checking /usr/local/include ...
hdf5 headers not found in /usr/local/include
checking /sw/include ...
hdf5 headers not found in /sw/include
checking /opt/include ...
hdf5 headers not found in /opt/include
checking /opt/local/include ...
hdf5 headers not found in /opt/local/include
checking /usr/include ...
hdf5 headers not found in /usr/include
----------------------------------------
Комментарии:
1. Есть удачи @marco?
2. @CharmingRobot После некоторого поиска в Google я нашел это: github.com/Unidata/netcdf4-python/issues/562 . Следуя предоставленной инструкции, мне удалось завершить установку из исходных текстов.