Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

When I try to install basemap on my raspberry 4 (Raspberry Pi OS Lite) I get the following error message.

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting basemap
  Using cached https://www.piwheels.org/simple/basemap/basemap-1.3.6-cp39-cp39-linux_armv7l.whl (200 kB)
Requirement already satisfied: pyshp<2.4,>=1.2 in ./.local/lib/python3.9/site-packages (from basemap) (2.3.1)
Collecting pyproj<3.5.0,>=1.9.3
  Using cached pyproj-3.4.1.tar.gz (217 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      ERROR: PROJ_INCDIR dir not found. Please set PROJ_INCDIR.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

On my Windows 11 PC, it works without problems.

Has somebody an idea how I can fix it?

You must be logged in to vote

Hi @capoaira. I am sorry to hear that. I didn't realise from your traceback that you were running Python 3.9, it seems that piwheels only has precompiled wheels for pyproj==1.9.6 and Python 3.7 but not Python 3.9. This means that your only solution is the DIY, i.e. you really need to build pyproj from source.

I was checking the traceback of the failed builds for pyproj==3.4.1 in piwheels, and one always finds errors similar to that in your original message:

proj executable not found. Please set the PROJ_DIR variable. For more information see: https://pyproj4.github.io/pyproj/stable/installation.html

You probably need to install the following libraries before (not tested, I just checked w…

Replies: 2 comments · 4 replies

Comment options

Hi @capoaira! The problem here is from the pyproj dependency. From what I see in https://www.piwheels.org/project/pyproj/, most of the latest builds are not successful, and therefore there are no latest binary wheels, so your command tries to build the latest pyproj from source but fails to do it.

I see that piwheels has successful binary wheels for pyproj==1.9.6. You can force the installation of this pyproj version by enforcing pip to prefer binary wheels:

python -m pip install --prefer-binary basemap

If this does not work, you can still install pyproj==1.9.6 before basemap, then the call to install basemap will identify that pyproj is already available on your system:

python -m pip install 'pyproj==1.9.6'
python -m pip install basemap

I hope you find this helpful. If it still does not work, feel free to mention what is causing troubles.

You must be logged in to vote
1 reply
@capoaira
Comment options

Thank you for the fast answer. Unfortunately, I have Bullseye, Python 3.9 and both of your suggestions does not work.

Comment options

Hi @capoaira. I am sorry to hear that. I didn't realise from your traceback that you were running Python 3.9, it seems that piwheels only has precompiled wheels for pyproj==1.9.6 and Python 3.7 but not Python 3.9. This means that your only solution is the DIY, i.e. you really need to build pyproj from source.

I was checking the traceback of the failed builds for pyproj==3.4.1 in piwheels, and one always finds errors similar to that in your original message:

proj executable not found. Please set the PROJ_DIR variable. For more information see: https://pyproj4.github.io/pyproj/stable/installation.html

You probably need to install the following libraries before (not tested, I just checked with aptitude search on Debian 11 but on x64):

sudo apt-get install proj-bin libproj-dev

If pyproj is smart enough, it will find the header and library folders during setup by calling the proj executable and then you can simply repeat your original pip install basemap command. Otherwise, you would need to set manually some environment variables (PROJ_DIR to something like /usr) before calling pip.

You must be logged in to vote
3 replies
@capoaira
Comment options

I tried it, but unfortunately this also does not work. But now I found the right pyproj GitHub repo and ask there. pyproj4/pyproj#1250
Thanks for your help :)

@molinav
Comment options

From your traceback in the other issue, the proj version in Debian 11 is too old (7.2.1) for pyproj 3.4.1, which requires at least proj 8.2.0.

The pyproj documentation contains the version compatibility matrix between pyproj and proj, see below:
https://pyproj4.github.io/pyproj/stable/installation.html

Based on this table, I would suggest that you repeat again the pyproj installation with an older version:

python -m pip install 'pyproj<3.3'

If it still does not work with 'pyproj<3.3', you can try decreasing the upper pin version until it works.

@capoaira
Comment options

Thank you so much, that worked 👍🏻

Answer selected by capoaira
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.