question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alpine with proj executable not found. Please set the PROJ_DIR variable

See original GitHub issue

Dockerfile

FROM python3.7-alpine

RUN apk add proj proj-dev
RUN pip install pyproj

get error

  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp_8k0qhw3
       cwd: /tmp/pip-install-zzif953y/pyproj
  Complete output (1 lines):
  proj executable not found. Please set the PROJ_DIR variable.For more information see: https://pyproj4.github.io/pyproj/stable/installation.html
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp_8k0qhw3 Check the logs for full command output.

apk add proj installed PROJ sucessful, but I can‘t get PROJ_DIR

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
maynewongcommented, Mar 28, 2020

@snowman2, found the solution by install proj-util, Thanks

apk add proj-util

/code # which proj
/usr/bin/proj
2reactions
mkdthangacommented, Jun 26, 2020

@snowman2, found the solution by install proj-util, Thanks

apk add proj-util

/code # which proj
/usr/bin/proj

[Solved] This helped: ENV PROJ_DIR=/usr

#################### Dockerfile (Updated the PROJ_DIR variable)################### FROM alpine:latest

ENV LC_ALL=C.UTF-8 ENV LANG=C.UTF-8 ENV PROJ_DIR=/usr

RUN addgroup -S appuser ; adduser -S appuser -G appuser -h /app ;
chown appuser:appuser /app

WORKDIR /app COPY --chown=appuser:appuser / /app

RUN apk add --update --no-cache python3 libpq uwsgi-python3;
apk add --no-cache python3-dev py3-pip alpine-sdk postgresql-dev postgresql;
*apk add proj proj-dev;
apk add proj-util;
/usr/bin/proj;*
pip3 install --upgrade pip ;
pip3 install --upgrade setuptools;
pip3 install --no-cache-dir -r requirements.txt

EXPOSE 5432

CMD [“python3”, “/app/subscriber_db.py”, “/app/resolver.py”]

####################### Requirements.txt ################ numpy==1.19.0 pandas==1.0.5 sqlalchemy==1.3.16 paho-mqtt==1.5.0 psycopg2==2.8.5 six==1.14.0 requests==2.24.0 cython pyproj scipy==1.5.0 statistics==1.0.3.5 matplotlib

###################### Error is fixed #####################

**Collecting pyproj
  Downloading pyproj-2.6.1.post1.tar.gz (545 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'**
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to install proj related Python packages in a Linux ...
Does it mean it is not installable into an alpine Linux? Notice, I have installed these packages with apk prior to installing Python...
Read more >
PyProj package installation PROJ_DIR variable - Stack Overflow
I am attempting to install pyproj , although am getting a Proj executable not found. Please set PROJ_DIR variable error.
Read more >
Installation - pyproj 3.5.0.dev0 documentation - GitHub Pages
This enables installing pyproj when the PROJ executables are not present but the header files exist. PROJ_DIR#. This is the path to the...
Read more >
Solving pyproj install error — ERROR: PROJ_DIR dir not ...
Solving pyproj install error — ERROR: PROJ_DIR dir not found. Please set PROJ_DIR. I don't know why, but after using this new M1...
Read more >
Python – PyProj package installation PROJ_DIR variable
packagepipprojpyprojpython. I am attempting to install pyproj , although am getting a Proj executable not found. Please set PROJ_DIR variable error.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found