-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip error on Macbook pro (m1 pro) #539
Comments
Hi @CaffreyR! Did you set the |
I'm getting the same problem, and I'm setting GEOS_DIR. |
Hi @ronaldbradford, thanks for the feedback. Could you confirm me if you can find a |
I was using GEOS_DIR=/usr/local/Cellar/geos/3.10.2 I've uninstalled and building form source right now to see if I can confirm it fixes my issuel |
I have installed geos 3.8.2 from source https://libgeos.org/usage/download/
|
FWIW 'm also getting the same error with
|
From your traceback I would infer that there is no problem with finding the header file but with finding the library itself. The problematic line could be this one in the setup file: basemap/packages/basemap/setup.py Line 45 in f9c9dab
The setup file tries to find the library assuming that the library filename follows the pattern |
I have installed geos 3.9.2 now from source https://libgeos.org/usage/download/
|
Let me interactively look at ~L45 and see. |
So yes, there is no *.so file on MacOS |
This traceback shows much more information. Something is going wrong when setting the compilation flags internally, because the Can you check if setting the environment variable |
You got it. This commit done by me is causing at least one of the problems. Before, only the presence of the header file was checked. I wanted to ensure that the library was actually there too, but only considered the extensions for Windows (.dll) and for manylinux (.so). I will need to update this. But still I am confused, because in your other traceback the first check seems to pass but later the compilation of What is clear is that I should create a GitHub Action to build MacOS wheels, because with them this error would have appeared fast. It is a bit late for me now but I will try to take a look to this either tomorrow afternoon or this weekend. |
Yep, I have set the dir in .bash_profile too. As you can see above. @molinav |
@CaffreyR You need to define
Still, this won't be enough because the setup file needs a correction as shown by @ronaldbradford above. Here the GEOS version does not play a role: the recommendation about the version limit for GEOS is due to a problem only when drawing the Antarctic coast. |
@ronaldbradford I have just pushed some commits to the |
@CaffreyR May I ask you to try my attempt of fixing your problem? You need to do:
|
OK!But there's something wrong with the git , maybe for network in my region, let me try it again later. @molinav |
@CaffreyR Be sure not to use |
see there is continuously disconnection, whether I use my VPN. Is there any chance that git broken? @molinav |
@CaffreyR It looks more like a network issue then. Maybe you can try a bit later in case the connection gets better. |
@molinav +1
|
@ronaldbradford Thanks! Great to see that it works. I will prepare a patch release 1.3.3 soon so that the source distributions from PyPI also work for MacOS. |
@molinav Finnally!!!! I downloaded the git! It really worked! Thanks so much! |
@CaffreyR Nice to hear! Thanks! |
I'll leave an update on how to solve this since even bug #539 of basemap has been fixed but I still had this issue even after. Then, @molinav 's lines might need some modifications. Check where geos is being stored, it might not be
Then,
And again, this will be different since the
And finally
Summary:
|
@isimo00 Thanks for the feedback. I recently created a hotfix version 1.3.3 with the corrections for Mac and pushed it to PyPI: Although there are no precompiled wheels for Mac, now you can install brew install geos
export GEOS_DIR="/usr/local"
python -m pip install basemap The good thing of this approach is that you do not need to deal with the specific commands related to using a repository clone. |
@molinav Oh great! Thanks for the answer and work, hopefully this will make it easier for future users. |
Thanks a lot @molinav ! Came here precisely to find this ❤️ Any chance to get a wheel at some point to conda-forge, please? |
@jucor Actually there was some work recently in the corresponding feedstock, and we managed to make the pipelines pass again with the new |
Hi @ihaseeburrehman. I am not an expert on macOS and I have no macOS machine to test, but this seems to be some issue related to the build toolchain rather than Since you were able to install |
Hello here :) |
Hi @xpivan! The
Please note that until I release |
Hi @molinav Thanks for your answer. I changed my numpy version to 1.23.0 Using the command
returns the same problem:
|
@xpivan Do you have GEOS on your system? When building From the traceback, "/opt/homebrew/Cellar/geos/3.10.2" does not look like a valid GEOS installation root, so my first guess would be that you do not have the GEOS library in this location. |
@molinav GEOS was properly installed but I realized reading your message that my export was pointing to the wrong version. I changed the export from to
It works like a charm. Thank you for taking time and helping solving for my issue. I really appreciated it. Cheers |
Hello, I have been trying to run code originally written for Python 2, but I have encountered some issues when attempting to run it Traceback (most recent call last): I have done everything that others have suggested in this issue, but I don't have any idea what's going on. I use a Mac M2, and I don't know if there is any problem with Macs. |
When I try to install basemap via pip3 on my Mac, I wish that instead of, or in addition to, failing to find the header file when I don't have |
Hi @ofloveandhate! The issue here is that with a Which is your current environment on MacOS (system version, Python version)? I am currently experimenting to create MacOS wheels with a local Mac mini (making GEOS be already bundled in the wheel), so it would be great if somebody can try them succesfully too before they become public. They seem to work in my computer, but I am not so experienced with Mac devices. |
@molinav I'm on Python 3.11 provided by homebrew, on a 2020 Mac Mini with an M1 chip running MacOS 13.6 (I cannot change the MacOS version, it's managed by my university). I guess I was mostly asking not for pip to provide Additional context for why I think an improved warning / message would help: I had been previously conditioned to suspect a missing header problem as a package bug, due to a few similar bugs I encountered in other Python packages. |
@ofloveandhate Thanks for the feedback, I will try to update the warning message in the following days so that the information for the end users is more clear. If it is ok for you, I will ask you for feedback once I prepare the new message. In the meantime, may I ask you to try the following wheel? I built it for Python 3.11 on macOS Sonoma (14.1.2), but using an older SDK (11.3), so it should also work with previous macOS versions. Please replace first the extension ".zip" with ".whl", since GitHub does not allow to attach wheel files in issue comments: After renaming the file to use ".whl" instead of ".zip", it should be possible to install
This |
@ofloveandhate May I ask if you found some time to try the wheel? |
@molinav It was successful out of the box! These are the homebrew packages I had installed: (I removed
and here's the output from pip as I installed:
|
(thanks for both your patience, and your follow-through!) |
So finally we have the first A simple example would be as follows:
And a simple test for this new environment:
I found out that it is very important for cc @jucor since you were asking about this very long ago. |
Brilliant! Thanks a lot for the update @molinav :) |
@Isaac0880 May I ask you to open a separate issue for the specific problem that you are describing? If you provide a complete traceback and a description of the environment, I can try to see what can be done. |
Hi! I am working on Macbook pro with basemap, but I met some issues. When I try to pip install basemap, there is something wrong with this. But I have already brew install geos, what's wrong? Thanks!

The text was updated successfully, but these errors were encountered: