ckan / ckanext-spatial

Geospatial extension for CKAN
http://docs.ckan.org/projects/ckanext-spatial
126 stars 193 forks source link

Error with pip install -r requirements.txt #315

Open martabracho opened 1 year ago

martabracho commented 1 year ago

I am trying to install ckanext-spatial on a ckan 2.10, python 3.9 on a devian 11 SO. The first problem I found was when I try to install the packages is that package libgeos-c1 in debian 11 is now libgeos-c1v5, also my so selects python-dev-is-python2 instead python-dev (This I don´t know if I may force choosing python3-dev). Once I've corrected this two issues it aparents to install fine the python packages and the ckanext-spatial plugin.

The problems comes when I try to install the requirenments with pip install -r requirements.txt. Then it gives me the next error: proj executable not found. Please set the PROJ_DIR variable. I've tried to install pyproj in my /lib/ckan/default/lib/python3.9/site-packages and put the envioronment variables to:

export PROJ_DIR=/lib/ckan/default/lib/python3.9/site-packages/pyproj

export PROJ_LIBDIR=/lib/ckan/default/lib/python3.9/site-packages/pyproj.libs

export PROJ_INCDIR=/lib/ckan/default/lib/python3.9/site-packages/pyproj/proj_dir

but still gives me this error: FileNotFoundError: [Errno 2] No such file or directory: '/lib/ckan/default/lib/python3.9/site-packages/pyproj/bin/proj'

martabracho commented 1 year ago

More information: I've realized that PROJ and PYPROJ are different packages. I've installed both with:

sudo apt-get install proj-bin

and

pip install pyproj

and then I had to run

pip install -r requirements.txt

with root user because it gave me an error of permission, and then it sais:

ERROR: Minimum supported PROJ version is 9.0.0, installed version is 7.2.1

martabracho commented 1 year ago

I've solved my problem. I installed PROJ version 9.0.0 form source and then compile it, because debian 11 does not install version 9.0.0 form the apt.

markstuart commented 1 year ago

Yeah, I have the same issue in the context of a Docker build. Using a python:3.10-slim-bullseye base image, if I apt install proj-bin it only gets version 7.x

I'm wondering why we even need the binary now, when we didn't appear to in earlier versions of pyproj? I'd prefer not to have to add commands to download and compile proj from source to my Dockerfile unless I really have to.

Maybe there's no prebuilt wheel available?

FedericOldani commented 11 months ago

Hey, I'm just stuck on this problem. Can you write the code to build PROJ >=9.0.0 from Dockerfile? Thank you