полностью застрял на этом.
пытается запустить Django (django == 1.11.9) в Python 3.6.3 virtualenv с PostGIS.HighSierra 10.13.6.
Изначально я установил gdal2 с помощью homebrew.brew устанавливает GDAL 2.4.0
при запуске make:
CPLUS_INCLUDE_PATH=/usr/include/gdal \
C_INCLUDE_PATH=/usr/include/gdal \
pip install GDAL==$(gdal-config --version | cut -f-2 -d'.')
Collecting GDAL==2.2
Installing collected packages: GDAL
Found existing installation: GDAL 2.4.0
Uninstalling GDAL-2.4.0:
Successfully uninstalled GDAL-2.4.0
Successfully installed GDAL-2.2.0
python manage.py migrate
...
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 6, in <module>
from .features import DatabaseFeatures
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/db/backends/postgis/features.py", line 1, in <module>
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/db/backends/base/features.py", line 4, in <module>
from django.contrib.gis.db.models import aggregates
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in <module>
from django.contrib.gis.db.models.aggregates import * # NOQA
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/db/models/aggregates.py", line 1, in <module>
from django.contrib.gis.db.models.fields import ExtentField
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/db/models/fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/forms/__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/forms/fields.py", line 4, in <module>
from django.contrib.gis.geos import GEOSException, GEOSGeometry
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/geos/__init__.py", line 5, in <module>
from .collections import ( # NOQA
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/geos/collections.py", line 11, in <module>
from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/geos/geometry.py", line 11, in <module>
from django.contrib.gis import gdal
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in <module>
from django.contrib.gis.gdal.datasource import DataSource
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/gdal/datasource.py", line 39, in <module>
from django.contrib.gis.gdal.driver import Driver
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/gdal/driver.py", line 5, in <module>
from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 9, in <module>
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/gdal/libgdal.py", line 49, in <module>
lgdal = CDLL(lib_path)
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/ctypes/__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libgdal.so, 6): image not found
Я пробовал несколько разных деинсталляций, установок и символических ссылок (и отключение csrutil).
предполагая, что это может быть проблема с версией GDAL, я понизил рейтинг с brew install
с 2.4 до 2.3.2 с помощью: http://www.kyngchaos.com/software/frameworks/
$ gdal-config --version
2.3.2
$ pip3 install gdal==2.3.2
changing mode of build/bdist.macosx-10.13-x86_64/wheel/GDAL-2.3.2.data/scripts/gdal_auth.py to 755
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/qw/bp7lqd0914q6xxqq01017h1h0000gn/T/pip-install-rnubsult/gdal/setup.py", line 435, in <module>
setup(**setup_kwargs)
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 213, in run
archive_basename = self.get_archive_basename()
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
assert tag == supported_tags[0]
AssertionError
----------------------------------------
Failed building wheel for gdal
Running setup.py clean for gdal
Failed to build gdal
Installing collected packages: gdal
Found existing installation: GDAL 2.3.0
Uninstalling GDAL-2.3.0:
Successfully uninstalled GDAL-2.3.0
Running setup.py install for gdal ... done
Successfully installed gdal-2.3.2
, но все же ошибка:
...
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/site-packages/django/contrib/gis/gdal/libgdal.py", line 49, in <module>
lgdal = CDLL(lib_path)
File "/Users/me/.pyenv/versions/3.6.3/lib/python3.6/ctypes/__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libgdal.so, 6): image not found
make: *** [update] Error 1
$ sudo find / -name libgdal.so
вернет несколько «операций, не разрешенных», так что похоже на системные разрешения или проблему безопасности?
есть предложения?
спасибо