ckanext-spatial icon indicating copy to clipboard operation
ckanext-spatial copied to clipboard

Error with pip install -r requirements.txt

Open martabracho opened this issue 2 years ago • 5 comments

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 avatar Sep 14 '23 06:09 martabracho

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 avatar Sep 14 '23 08:09 martabracho

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.

martabracho avatar Sep 15 '23 09:09 martabracho

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?

markstuart avatar Nov 13 '23 22:11 markstuart

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

FedericOldani avatar Dec 19 '23 15:12 FedericOldani