问题
I want to deploy geodjango in aws beanstalk.
I have already tried this solution. It worked before.
commands:
01_yum_update:
command: sudo yum -y update
02_epel_repo:
command: sudo yum-config-manager -y --enable epel
03_install_gdal_packages:
command: yum --enablerepo=epel -y install gdal gdal-devel
packages:
yum:
git: []
postgresql96-devel: []
gettext: []
libjpeg-turbo-devel: []
libffi-devel: []
But right now it's showing this error.
AttributeError: /usr/lib64/libgdal.so.1: undefined symbol: GDALGetMetadataDomainList
(ElasticBeanstalk::ExternalInvocationError)
Here is the full error log
回答1:
Looks like using Django==2.2.1
messing the things. The current requirements.txt
which worked is as follows:
Django==2.1.8
django-cors-headers==2.5.2
django-debug-toolbar==1.11
django-extensions==2.1.6
django-model-utils==3.1.2
djangorestframework==3.9.2
psycopg2-binary==2.8.2
pytz==2019.1
six==1.12.0
sqlparse==0.3.0
回答2:
I ran into this issue as well, turns out django 2.2 drops support for GDAL 1.9 and 1.10, the EPEL repositorie has version 1.7. I ended up installing everything from source with the following script:
commands:
01_execute_script:
test: test ! -e /usr/bin/gdalinfo
command: "/tmp/gdal_install.sh"
files:
"/tmp/gdal_install.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
# Geos
cd ~
wget -O ~/geos-3.7.2.tar.bz2 http://download.osgeo.org/geos/geos-3.7.2.tar.bz2
tar xjf ~/geos-3.7.2.tar.bz2
cd ~/geos-3.7.2
./configure --prefix=/usr --enable-python
make
sudo make install
# Proj4
cd ~
wget -O ~/proj-6.1.0.tar.gz http://download.osgeo.org/proj/proj-6.1.0.tar.gz
wget -O ~/proj-datumgrid-1.7.tar.gz http://download.osgeo.org/proj/proj-datumgrid-1.7.tar.gz
tar xzf ~/proj-6.1.0.tar.gz
cd ~/proj-6.1.0/data
tar xzf ~/proj-datumgrid-1.7.tar.gz
cd ..
./configure --prefix=/usr
make
sudo make install
# GDAL
cd ~
wget -O ~/gdal-2.3.2.tar.gz http://download.osgeo.org/gdal/2.3.2/gdal-2.3.2.tar.gz
tar xzf ~/gdal-2.3.2.tar.gz
cd ~/gdal-2.3.2
./configure --prefix=/usr --with-python --with-pg --with-geos --with-curl
make
sudo make install
sudo ldconfig
If anyone finds a better solution, please let us know, building everything from source can take more than 30 minutes depending on instance size
来源:https://stackoverflow.com/questions/55877882/beanstalk-migration-failing-for-geodjango