Closed SongJaeIn closed 11 months ago
Hi @SongJaeIn! It looks like the problem is coming from the current build dependency definition in the pyproject.toml
, because it is pinning to a very specific numpy
version (v1.16.6 for Python 3.9), and your computer fails to build this numpy
version from source. I think https://github.com/numpy/numpy/issues/17987 is the issue that you are seeing on MacOS, which was not solved until numpy
v1.21.0.
Your installed numpy
library is newer (v1.23.1), which is perfectly normal. The original reason for being so specific with the numpy
version for building is that we need to compile the distributed precompiled binary wheels with a very old numpy
version to ensure that they work in as many computers as possible. For example, if the distributed wheels were compiled with numpy
v1.23.1, later a user with numpy
v1.19.5 would not be able to use them, but building basemap
with an old numpy
and later using basemap
with a newer numpy
does work. However, the combination of the former numpy
bug on MacOS and the numpy
pinning in the pyproject.toml
is making you impossible to install basemap
.
Probably the implementation in pyproject.toml
is at the moment too overkilling, and it could be enough to replace the numpy
requirements so that they use >=
instead of ==
. Anyhow in the GitHub workflows I install old numpy
libraries on purpose before building basemap
, so the workflows would not suffer with the change from ==
to >=
.
@SongJaeIn Can you try installing from the latest commit in the repository? You can do:
python -m pip install https://github.com/matplotlib/basemap/archive/refs/heads/develop.zip#subdirectory=packages/basemap
After installing, I also recommend you do the simple test:
from mpl_toolkits import basemap
to ensure that the _geoslib
extension was built properly and that you can import it.
Ok so my changes seem to break the current GitHub workflows... I will need to edit the pyproject.toml
file with specific build dependencies for MacOS.
with your help, installation of Basemap was successful
However, when I test with
from mpl_toolkits import basemap
an error about _geoslib appears.
RuntimeError Traceback (most recent call last) RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
SystemError Traceback (most recent call last) Input In [1], in <cell line: 1>() ----> 1 from mpl_toolkits.basemap import Basemap
File /usr/local/lib/python3.9/site-packages/mpl_toolkits/basemap/init.py:53, in
51 import numpy as np 52 import numpy.ma as ma ---> 53 import _geoslib 54 import functools 56 # basemap data files now installed in lib/matplotlib/toolkits/basemap/data 57 # check to see if environment variable BASEMAPDATA set to a directory, 58 # and if so look for the data there. SystemError: execution of module _geoslib raised unreported exception
above is the error.
@SongJaeIn Can you try once again with the same command? I have just updated the pyproject.toml
file because my first attempt was not successful and it also broke the builds for Windows and GNU/Linux. Now the pyproject.toml
file looks like this:
https://github.com/matplotlib/basemap/blob/bd8b7bec081d20088a04b9e202150b56cc87e7c6/packages/basemap/pyproject.toml#L6
so now your computer should try to build basemap
using numpy
v1.21.4, which should be compilable on MacOS. And once built, you should be able to use basemap
with any newer numpy
. First ensure to uninstall the broken basemap
:
python -m pip uninstall basemap
python -m pip install https://github.com/matplotlib/basemap/archive/refs/heads/develop.zip#subdirectory=packages/basemap
python -c "from mpl_toolkits import basemap; print(basemap)"
RuntimeError Traceback (most recent call last) RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
@SongJaeIn By the way, this RuntimeError
is the reason why in the beginning we pin to very old numpy
versions when building. It also gave me a bit of headaches in the past but was solved for Windows and GNU/Linux. Unfortunately I did not have a Mac around to also test the solution on Mac at that time, and you were unlucky that MacOS had this build problem with numpy
until v1.21.0.
@molinav Now it works perfectly. Thank you very much. and I am willing to test your new builds in MacOS in the future. Thank you again, have a great weekend!
Great to hear that, @SongJaeIn! When I get some more time, I will prepare a patch release v1.3.4 with this correction and then you will be able to install basemap
with pip
as you were trying to do in the beginning.
Great to hear that, @SongJaeIn! When I get some more time, I will prepare a patch release v1.3.4 with this correction and then you will be able to install
basemap
withpip
as you were trying to do in the beginning.
@molinav I have installed Basemap -1.3.6+dev when I try python -c "from mpl_toolkits import basemap; print(basemap)" it gave me this <module 'mpl_toolkits.basemap' from '/opt/homebrew/Caskroom/miniconda/base/envs/matplot/lib/python3.10/site-packages/mpl_toolkits/basemap/init.py'>
but when I try to test Basemap in Anaconda it says 'module not found' Furthermore , I tried pip install Basemap , it was unsuccessful (cc1: fatal error: src/_geoslib.c: No such file or directory) I set environment export GEOS_DIR=/opt/homebrew/Cellar/geos/3.11.1/
I have Mac with M1-max running Ventura 13.0.1
Appreciate if you can advise.
thanks
Hi @ihaseeburrehman! I am not sure if I am understanding the issue. Do you have separate installations of Python, a normal one (e.g. from Homebrew, I assume Miniconda based on the basemap
module path) and another one coming from Anaconda?
The installation procedure for Miniconda and Anaconda should be the same in both cases on MacOS with M1. Since there are no precompiled wheels or conda packages for MacOS M1, you need to install basemap
from the source distribution in PyPI with:
python -m pip install basemap
or it is even better if you install the dependencies manually with conda install
and later do:
python -m pip install --no-deps basemap
Since you were able to install basemap
for Miniconda, you seem to also have a working C/C++ compiler available to build the _geoslib
module, so this is also not an issue. If you provide more feedback I can try to help a bit more.
Hi Thanks for your response. Let me try again to explain my issue in Mac terminal I have successfully installed basemap and also passed the test by executing the following command python -c "from mpl_toolkits import basemap; print(basemap)" I have attached the terminal window screenshot. But when I tried in Anaconda (Spyder) from mpl_toolkits import basemap
it says ImportError: cannot import name 'basemap' from 'mpl_toolkits' (unknown location)
I have attached the Spyder kernal screenshot.
I am wondering why anaconda (Spyder) is not importing basemap from mpl_toolkits.
Thanks for the additional feedback, @ihaseeburrehman. The issue is that basemap
is installed only in one of your Python installations:
basemap
is installed for your Python from the /opt/homebrew/Caskroom/miniconda/base
installation (Miniconda)./opt/anaconda3
installation (Anaconda3), for which basemap
is not installed.The Python installations do not share packages, each has its own installation path. To have basemap
in Spyder3, you need to install it for the appropriate Python installation, i.e. you need to do python -m pip install basemap
after being sure that "python" does point to the Anaconda3 Python, not to the Miniconda one.
You can check where Python is pointing to with:
command -v python
I struggling with installation of basemap in anaconda. I tried pip install basemap
it says "could not built wheels for basemap." it similar issue reported in #547
I also set the environment for geos export GEOS_DIR=/opt/homebrew/Cellar/geos/3.11.1/
but not able to install, any suggestion ?
Hi @molinav Thanks for your feedback . I skip installation of basemap in Anaconda (Spyder). Because in the end I need to use basemap in python console of QGIS. As I mentioned earlier basemap is installed in miniconda (from homebrew) successfully but when I tried to import it in QGIS python console it says "no module named _geoslib". Geoslib is also installed with version 3.11.1. I tried the same procedure on Linux machine and it completed with no error. But on Mac M1 it is giving me this error. I am not sure, but I think I need to define the geoslib path in QGIS (I did this in QGIS env), but not getting results.
see the attached the picture. wonder if you can suggest something. thanks
Hi @molinav,
I tried installing basemap using the commands given above:
pip install https://github.com/matplotlib/basemap/archive/refs/heads/develop.zip#subdirectory=packages/basemap
but receive the same error:
Collecting basemap-data<1.4,>=1.3.2 (from basemap->ezgpx) Using cached basemap_data-1.3.2-py2.py3-none-any.whl (30.5 MB) Collecting pyshp<2.4,>=1.2 (from basemap->ezgpx) Using cached pyshp-2.3.1-py2.py3-none-any.whl (46 kB) Collecting pyproj<3.6.0,>=1.9.3 (from basemap->ezgpx) Using cached pyproj-3.5.0-cp311-cp311-macosx_11_0_arm64.whl (5.7 MB) ... ERROR: Failed building wheel for basemap Failed to build basemap ERROR: Could not build wheels for basemap, which is required to install pyproject.toml-based projects
Any ideas? Should I start a new issue?
Hi @dvvilkins! You can check if the issue is the same as described in #583. The latest Cython 3.0.0 conflicts with the current _geoslib.pyx
file. A hotfix version 1.3.8 is ongoing but still not released, although you can install directly from the hotfix-1.3.8
branch instead of develop
. In case it does not work, you can paste the complete traceback to understand the source of the issue.
I am creating MacOS ARM64 wheels locally before I publish them into PyPI. Is somebody with MacOS ARM64 willing to try them? Then I would be sure that what I am uploading to PyPI is actually working (I am not that experienced with MacOS). I would need to know the target Python that you are using.
The wheels are bundling GEOS 3.6.5, so there would be no need to install anything manually apart from the basemap
wheel itself.
@molinav I have MacOS ARM64 and am having trouble installing basemap because of the issues described above. Would be happy to try it out, I'm on Python 3.9.7.
Thanks @tamidodo! I will try to have the wheels ready by end of today. I will attach them here, just with ".zip" extension instead of ".whl" due to GitHub limitations on the message attachments.
What is the environment in which you use Python? From python.org installer, from pyenv+homebrew, from Anaconda/Miniforge?
Sounds good, I use Anaconda.
@tamidodo Sorry for the late reply, I was busier than expected. I attach here the current wheel file for Python 3.9 (you need to remove the .zip at the end after downloading): basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl.zip
Since you are working with Anaconda, I would suggest to install this wheel without the dependencies, and afterwards install the dependencies manually with conda
(to keep within the conda
ecosystem as much as possible):
python -m pip install --no-deps basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
conda install numpy matplotlib pyproj pyshp packaging basemap-data
The wheel bundles its own precompiled GEOS dylib, which only depends on system libraries, so I hope it works for you without any tweaking. I am happy to hear any feedback from you!
So after downloading the file, I changed the filename:
mv basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl.zip basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
And then tried to run the first command in my environment with python version 3.9.7 and got this error back:
@tamidodo I also get the same error as you when I create a new virtual environment, but in my case it is caused by the pip
default version (20.3.4), which is too old, I remember reading somewhere that macosx_11_0
was not identified as a valid platform for cases in which it should be so. If I upgrade pip
then the installation proceeds as expected:
vic@alpha:~$ python3.9 -m venv py39
vic@alpha:~$ . py39/bin/activate
(py39) vic@alpha:~$ python -m pip install basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
ERROR: basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl is not a supported wheel on this platform.
(py39) vic@alpha:~$ python -m pip --version
pip 20.2.3 from /Users/vic/py39/lib/python3.9/site-packages/pip (python 3.9)
(py39) vic@alpha:~$ python -m pip install --upgrade pip
Collecting pip
Using cached pip-23.3.2-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
Successfully installed pip-23.3.2
(py39) vic@alpha:~$ python -m pip --version
pip 23.3.2 from /Users/vic/py39/lib/python3.9/site-packages/pip (python 3.9)
(py39) vic@alpha:~$ python -m pip install basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
Processing ./basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
Collecting basemap-data<1.4,>=1.3.2 (from basemap==1.4.0.dev0)
Using cached basemap_data-1.3.2-py2.py3-none-any.whl (30.5 MB)
Collecting pyshp<2.4,>=1.2 (from basemap==1.4.0.dev0)
Using cached pyshp-2.3.1-py2.py3-none-any.whl (46 kB)
Collecting matplotlib<3.8,>=1.5 (from basemap==1.4.0.dev0)
Using cached matplotlib-3.7.4-cp39-cp39-macosx_11_0_arm64.whl.metadata (5.7 kB)
Collecting pyproj<3.7.0,>=1.9.3 (from basemap==1.4.0.dev0)
Using cached pyproj-3.6.1-cp39-cp39-macosx_11_0_arm64.whl.metadata (31 kB)
Collecting packaging<24.0,>=16.0 (from basemap==1.4.0.dev0)
Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Collecting numpy<1.27,>=1.21 (from basemap==1.4.0.dev0)
Using cached numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl.metadata (61 kB)
Collecting contourpy>=1.0.1 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached contourpy-1.2.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (5.8 kB)
Collecting cycler>=0.10 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
Collecting fonttools>=4.22.0 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached fonttools-4.47.0-cp39-cp39-macosx_10_9_universal2.whl.metadata (157 kB)
Collecting kiwisolver>=1.0.1 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached kiwisolver-1.4.5-cp39-cp39-macosx_11_0_arm64.whl.metadata (6.4 kB)
Collecting pillow>=6.2.0 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached Pillow-10.1.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (9.5 kB)
Collecting pyparsing>=2.3.1 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
Collecting python-dateutil>=2.7 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting importlib-resources>=3.2.0 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached importlib_resources-6.1.1-py3-none-any.whl.metadata (4.1 kB)
Collecting certifi (from pyproj<3.7.0,>=1.9.3->basemap==1.4.0.dev0)
Using cached certifi-2023.11.17-py3-none-any.whl.metadata (2.2 kB)
Collecting zipp>=3.1.0 (from importlib-resources>=3.2.0->matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Downloading zipp-3.17.0-py3-none-any.whl.metadata (3.7 kB)
Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached matplotlib-3.7.4-cp39-cp39-macosx_11_0_arm64.whl (7.3 MB)
Using cached numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl (14.0 MB)
Using cached packaging-23.2-py3-none-any.whl (53 kB)
Using cached pyproj-3.6.1-cp39-cp39-macosx_11_0_arm64.whl (4.9 MB)
Using cached contourpy-1.2.0-cp39-cp39-macosx_11_0_arm64.whl (242 kB)
Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
Using cached fonttools-4.47.0-cp39-cp39-macosx_10_9_universal2.whl (2.8 MB)
Using cached importlib_resources-6.1.1-py3-none-any.whl (33 kB)
Using cached kiwisolver-1.4.5-cp39-cp39-macosx_11_0_arm64.whl (66 kB)
Using cached Pillow-10.1.0-cp39-cp39-macosx_11_0_arm64.whl (3.3 MB)
Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
Using cached certifi-2023.11.17-py3-none-any.whl (162 kB)
Downloading zipp-3.17.0-py3-none-any.whl (7.4 kB)
Installing collected packages: zipp, six, pyshp, pyparsing, pillow, packaging, numpy, kiwisolver, fonttools, cycler, certifi, basemap-data, python-dateutil, pyproj, importlib-resources, contourpy, matplotlib, basemap
Successfully installed basemap-1.4.0.dev0 basemap-data-1.3.2 certifi-2023.11.17 contourpy-1.2.0 cycler-0.12.1 fonttools-4.47.0 importlib-resources-6.1.1 kiwisolver-1.4.5 matplotlib-3.7.4 numpy-1.26.2 packaging-23.2 pillow-10.1.0 pyparsing-3.1.1 pyproj-3.6.1 pyshp-2.3.1 python-dateutil-2.8.2 six-1.16.0 zipp-3.17.0
(py39) vic@alpha:~$ python -c "from mpl_toolkits import basemap; print(basemap.__version__)"
1.4.0-dev
There is a couple of differences in my environment with respect to yours: Python 3.9 is installed from the official Python website (universal2 installer), and I am using simple Python virtual environments and pip
to fetch dependencies (no conda
). However, I cannot guess why it does not work in your environment, because you pip
seems up to date.
Some possible things I can be thinking of:
pip
with conda
, does it say that it is already up to date (23.3.2)?I have just tested with pyenv
installed from homebrew
, in this case using pyenv
to install Python 3.9.7 and then using the wheel works directly because the pip
version is already 21.2.3:
vic@alpha:~$ pyenv versions
* system (set by PYENV_VERSION environment variable)
3.10.13
3.11.6
3.11.6/envs/py311
3.12.0
3.12.0/envs/py312
py311 --> /Users/vic/.pyenv/versions/3.11.6/envs/py311
py312 --> /Users/vic/.pyenv/versions/3.12.0/envs/py312
vic@alpha:~$ pyenv install 3.9.7
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.7.tar.xz...
-> https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tar.xz
Installing Python-3.9.7...
patching file 'Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst'
patching file configure
patching file configure.ac
python-build: use readline from homebrew
python-build: use ncurses from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.7 to /Users/vic/.pyenv/versions/3.9.7
vic@alpha:~$ pyenv shell 3.9.7
vic@alpha:~$ python -V
Python 3.9.7
vic@alpha:~$ python -m pip --version
pip 21.2.3 from /Users/vic/.pyenv/versions/3.9.7/lib/python3.9/site-packages/pip (python 3.9)
vic@alpha:~$ python -m pip install basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
Processing ./basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
Collecting basemap-data<1.4,>=1.3.2
Downloading basemap_data-1.3.2-py2.py3-none-any.whl (30.5 MB)
|████████████████████████████████| 30.5 MB 27.5 MB/s
Collecting packaging<24.0,>=16.0
Using cached packaging-23.2-py3-none-any.whl (53 kB)
Collecting pyshp<2.4,>=1.2
Downloading pyshp-2.3.1-py2.py3-none-any.whl (46 kB)
|████████████████████████████████| 46 kB 23.4 MB/s
Collecting numpy<1.27,>=1.21
Downloading numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl (14.0 MB)
|████████████████████████████████| 14.0 MB 44.9 MB/s
Collecting pyproj<3.7.0,>=1.9.3
Downloading pyproj-3.6.1-cp39-cp39-macosx_11_0_arm64.whl (4.9 MB)
|████████████████████████████████| 4.9 MB 39.6 MB/s
Collecting matplotlib<3.8,>=1.5
Downloading matplotlib-3.7.4-cp39-cp39-macosx_11_0_arm64.whl (7.3 MB)
|████████████████████████████████| 7.3 MB 41.7 MB/s
Collecting kiwisolver>=1.0.1
Downloading kiwisolver-1.4.5-cp39-cp39-macosx_11_0_arm64.whl (66 kB)
|████████████████████████████████| 66 kB 22.9 MB/s
Collecting python-dateutil>=2.7
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
|████████████████████████████████| 247 kB 41.4 MB/s
Collecting contourpy>=1.0.1
Downloading contourpy-1.2.0-cp39-cp39-macosx_11_0_arm64.whl (242 kB)
|████████████████████████████████| 242 kB 48.7 MB/s
Collecting fonttools>=4.22.0
Downloading fonttools-4.47.0-cp39-cp39-macosx_10_9_universal2.whl (2.8 MB)
|████████████████████████████████| 2.8 MB 50.9 MB/s
Collecting cycler>=0.10
Downloading cycler-0.12.1-py3-none-any.whl (8.3 kB)
Collecting pillow>=6.2.0
Downloading Pillow-10.1.0-cp39-cp39-macosx_11_0_arm64.whl (3.3 MB)
|████████████████████████████████| 3.3 MB 42.9 MB/s
Collecting importlib-resources>=3.2.0
Downloading importlib_resources-6.1.1-py3-none-any.whl (33 kB)
Collecting pyparsing>=2.3.1
Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
Collecting zipp>=3.1.0
Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB)
Collecting certifi
Downloading certifi-2023.11.17-py3-none-any.whl (162 kB)
|████████████████████████████████| 162 kB 44.2 MB/s
Collecting six>=1.5
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: zipp, six, numpy, python-dateutil, pyparsing, pillow, packaging, kiwisolver, importlib-resources, fonttools, cycler, contourpy, certifi, pyshp, pyproj, matplotlib, basemap-data, basemap
Successfully installed basemap-1.4.0.dev0 basemap-data-1.3.2 certifi-2023.11.17 contourpy-1.2.0 cycler-0.12.1 fonttools-4.47.0 importlib-resources-6.1.1 kiwisolver-1.4.5 matplotlib-3.7.4 numpy-1.26.2 packaging-23.2 pillow-10.1.0 pyparsing-3.1.1 pyproj-3.6.1 pyshp-2.3.1 python-dateutil-2.8.2 six-1.16.0 zipp-3.17.0
vic@alpha:~$ python -c "from mpl_toolkits import basemap; print(basemap.__version__)"
1.4.0-dev
I will try now with Anaconda or Miniforge and check.
I have just tested with Anaconda downloaded from their website (arm64 installer). I created an environment msc
with Python version 3.9.7:
(base) vic@alpha:~$ conda create -n msc python=3.9.7
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 23.7.4
latest version: 23.11.0
Please update conda by running
$ conda update -n base -c defaults conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.11.0
## Package Plan ##
environment location: /Users/vic/anaconda3/envs/msc
added / updated specs:
- python=3.9.7
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2023.12.12 | hca03da5_0 127 KB
expat-2.5.0 | h313beb8_0 144 KB
openssl-1.1.1w | h1a28f6b_0 3.1 MB
pip-23.3.1 | py39hca03da5_0 2.6 MB
python-3.9.7 | hc70090a_1 9.6 MB
setuptools-68.2.2 | py39hca03da5_0 933 KB
wheel-0.41.2 | py39hca03da5_0 107 KB
xz-5.4.5 | h80987f9_0 366 KB
------------------------------------------------------------
Total: 17.0 MB
The following NEW packages will be INSTALLED:
ca-certificates pkgs/main/osx-arm64::ca-certificates-2023.12.12-hca03da5_0
expat pkgs/main/osx-arm64::expat-2.5.0-h313beb8_0
libcxx pkgs/main/osx-arm64::libcxx-14.0.6-h848a8c0_0
libffi pkgs/main/osx-arm64::libffi-3.4.4-hca03da5_0
libiconv pkgs/main/osx-arm64::libiconv-1.16-h1a28f6b_2
ncurses pkgs/main/osx-arm64::ncurses-6.4-h313beb8_0
openssl pkgs/main/osx-arm64::openssl-1.1.1w-h1a28f6b_0
pip pkgs/main/osx-arm64::pip-23.3.1-py39hca03da5_0
python pkgs/main/osx-arm64::python-3.9.7-hc70090a_1
readline pkgs/main/osx-arm64::readline-8.2-h1a28f6b_0
setuptools pkgs/main/osx-arm64::setuptools-68.2.2-py39hca03da5_0
sqlite pkgs/main/osx-arm64::sqlite-3.41.2-h80987f9_0
tk pkgs/main/osx-arm64::tk-8.6.12-hb8d0fd4_0
tzdata pkgs/main/noarch::tzdata-2023c-h04d1e81_0
wheel pkgs/main/osx-arm64::wheel-0.41.2-py39hca03da5_0
xz pkgs/main/osx-arm64::xz-5.4.5-h80987f9_0
zlib pkgs/main/osx-arm64::zlib-1.2.13-h5a0b063_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate msc
#
# To deactivate an active environment, use
#
# $ conda deactivate
(base) vic@alpha:~$ conda activate msc
(msc) vic@alpha:~$ python -V
Python 3.9.7
And then I have tried to install basemap
using the two-step approach (pip
for the wheel without dependencies, conda
for the dependencies added manually):
(msc) vic@alpha:~$ python -m pip install --no-deps basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
Processing ./basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
Installing collected packages: basemap
Successfully installed basemap-1.4.0.dev0
(msc) vic@alpha:~$ conda install numpy matplotlib pyproj pyshp packaging basemap-data
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 23.7.4
latest version: 23.11.0
Please update conda by running
$ conda update -n base -c defaults conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.11.0
## Package Plan ##
environment location: /Users/vic/anaconda3/envs/msc
added / updated specs:
- basemap-data
- matplotlib
- numpy
- packaging
- pyproj
- pyshp
The following packages will be downloaded:
package | build
---------------------------|-----------------
basemap-data-1.3.6 | py39hca03da5_1 25.7 MB
certifi-2023.11.17 | py39hca03da5_0 159 KB
contourpy-1.2.0 | py39h48ca7d4_0 239 KB
importlib_resources-6.1.1 | py39hca03da5_0 56 KB
kiwisolver-1.4.4 | py39h313beb8_0 61 KB
krb5-1.20.1 | h8380606_1 1.2 MB
libcurl-8.2.1 | h0f1d93c_0 343 KB
libdeflate-1.17 | h80987f9_1 55 KB
libedit-3.1.20230828 | h80987f9_0 155 KB
libnghttp2-1.52.0 | h10c0552_1 628 KB
libssh2-1.10.0 | h449679c_2 289 KB
matplotlib-3.8.0 | py39hca03da5_0 9 KB
matplotlib-base-3.8.0 | py39h46d7db6_0 6.7 MB
numpy-1.26.2 | py39h3b2db8e_0 11 KB
numpy-base-1.26.2 | py39ha9811e2_0 5.8 MB
packaging-23.1 | py39hca03da5_0 77 KB
pillow-10.0.1 | py39h3b245a6_0 684 KB
proj-8.2.1 | hb8d25fd_0 2.4 MB
pyparsing-3.0.9 | py39hca03da5_0 149 KB
pyproj-3.4.1 | py39h80bd9b1_0 421 KB
pyshp-2.1.3 | pyhd3eb1b0_0 37 KB
tornado-6.3.3 | py39h80987f9_0 635 KB
zipp-3.11.0 | py39hca03da5_0 20 KB
------------------------------------------------------------
Total: 45.7 MB
The following NEW packages will be INSTALLED:
basemap-data pkgs/main/osx-arm64::basemap-data-1.3.6-py39hca03da5_1
blas pkgs/main/osx-arm64::blas-1.0-openblas
brotli pkgs/main/osx-arm64::brotli-1.0.9-h1a28f6b_7
brotli-bin pkgs/main/osx-arm64::brotli-bin-1.0.9-h1a28f6b_7
c-ares pkgs/main/osx-arm64::c-ares-1.19.1-h80987f9_0
certifi pkgs/main/osx-arm64::certifi-2023.11.17-py39hca03da5_0
contourpy pkgs/main/osx-arm64::contourpy-1.2.0-py39h48ca7d4_0
cycler pkgs/main/noarch::cycler-0.11.0-pyhd3eb1b0_0
fonttools pkgs/main/noarch::fonttools-4.25.0-pyhd3eb1b0_0
freetype pkgs/main/osx-arm64::freetype-2.12.1-h1192e45_0
giflib pkgs/main/osx-arm64::giflib-5.2.1-h80987f9_3
importlib_resourc~ pkgs/main/osx-arm64::importlib_resources-6.1.1-py39hca03da5_0
jpeg pkgs/main/osx-arm64::jpeg-9e-h80987f9_1
kiwisolver pkgs/main/osx-arm64::kiwisolver-1.4.4-py39h313beb8_0
krb5 pkgs/main/osx-arm64::krb5-1.20.1-h8380606_1
lcms2 pkgs/main/osx-arm64::lcms2-2.12-hba8e193_0
lerc pkgs/main/osx-arm64::lerc-3.0-hc377ac9_0
libbrotlicommon pkgs/main/osx-arm64::libbrotlicommon-1.0.9-h1a28f6b_7
libbrotlidec pkgs/main/osx-arm64::libbrotlidec-1.0.9-h1a28f6b_7
libbrotlienc pkgs/main/osx-arm64::libbrotlienc-1.0.9-h1a28f6b_7
libcurl pkgs/main/osx-arm64::libcurl-8.2.1-h0f1d93c_0
libdeflate pkgs/main/osx-arm64::libdeflate-1.17-h80987f9_1
libedit pkgs/main/osx-arm64::libedit-3.1.20230828-h80987f9_0
libev pkgs/main/osx-arm64::libev-4.33-h1a28f6b_1
libgfortran pkgs/main/osx-arm64::libgfortran-5.0.0-11_3_0_hca03da5_28
libgfortran5 pkgs/main/osx-arm64::libgfortran5-11.3.0-h009349e_28
libnghttp2 pkgs/main/osx-arm64::libnghttp2-1.52.0-h10c0552_1
libopenblas pkgs/main/osx-arm64::libopenblas-0.3.21-h269037a_0
libpng pkgs/main/osx-arm64::libpng-1.6.39-h80987f9_0
libssh2 pkgs/main/osx-arm64::libssh2-1.10.0-h449679c_2
libtiff pkgs/main/osx-arm64::libtiff-4.5.1-h313beb8_0
libwebp pkgs/main/osx-arm64::libwebp-1.3.2-ha3663a8_0
libwebp-base pkgs/main/osx-arm64::libwebp-base-1.3.2-h80987f9_0
llvm-openmp pkgs/main/osx-arm64::llvm-openmp-14.0.6-hc6e5704_0
lz4-c pkgs/main/osx-arm64::lz4-c-1.9.4-h313beb8_0
matplotlib pkgs/main/osx-arm64::matplotlib-3.8.0-py39hca03da5_0
matplotlib-base pkgs/main/osx-arm64::matplotlib-base-3.8.0-py39h46d7db6_0
munkres pkgs/main/noarch::munkres-1.1.4-py_0
numpy pkgs/main/osx-arm64::numpy-1.26.2-py39h3b2db8e_0
numpy-base pkgs/main/osx-arm64::numpy-base-1.26.2-py39ha9811e2_0
openjpeg pkgs/main/osx-arm64::openjpeg-2.3.0-h7a6adac_2
packaging pkgs/main/osx-arm64::packaging-23.1-py39hca03da5_0
pillow pkgs/main/osx-arm64::pillow-10.0.1-py39h3b245a6_0
proj pkgs/main/osx-arm64::proj-8.2.1-hb8d25fd_0
pyparsing pkgs/main/osx-arm64::pyparsing-3.0.9-py39hca03da5_0
pyproj pkgs/main/osx-arm64::pyproj-3.4.1-py39h80bd9b1_0
pyshp pkgs/main/noarch::pyshp-2.1.3-pyhd3eb1b0_0
python-dateutil pkgs/main/noarch::python-dateutil-2.8.2-pyhd3eb1b0_0
six pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1
tornado pkgs/main/osx-arm64::tornado-6.3.3-py39h80987f9_0
zipp pkgs/main/osx-arm64::zipp-3.11.0-py39hca03da5_0
zstd pkgs/main/osx-arm64::zstd-1.5.5-hd90d995_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(msc) vic@alpha:~$ python -c "from mpl_toolkits import basemap; print(basemap.__version__)"
1.4.0-dev
- Is your Anaconda installation using Python for arm64 or for Python x86_64? It could be that the error message comes from a mismatch in the architecture.
Sorry for the delay, been busy with holiday things but this was a lovely Christmas surprise! This was what it was, my Anaconda installed Python for x86_64. Got the correct python for arm64 from miniforge and had no issues installing the wheel and getting it running! Thank you for your work on this, seems good to go!
@tamidodo One very last update, I managed to prepare the conda
packages for MacOS ARM64 in the conda-forge
channel. So now it should be even simpler as long as your environment stays within conda-forge
, since you can install basemap
with conda
directly:
(base) vic@alpha:~$ conda create -y -n msc39 -c conda-forge python=3.9 basemap
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 23.3.1
latest version: 23.11.0
Please update conda by running
$ conda update -n base -c conda-forge conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.11.0
## Package Plan ##
environment location: /opt/homebrew/Caskroom/miniforge/base/envs/msc39
added / updated specs:
- basemap
- python=3.9
The following NEW packages will be INSTALLED:
basemap conda-forge/osx-arm64::basemap-1.3.9-py39hb118012_0
basemap-data conda-forge/noarch::basemap-data-1.3.2-pyhd8ed1ab_3
brotli conda-forge/osx-arm64::brotli-1.1.0-hb547adb_1
brotli-bin conda-forge/osx-arm64::brotli-bin-1.1.0-hb547adb_1
bzip2 conda-forge/osx-arm64::bzip2-1.0.8-h93a5062_5
c-ares conda-forge/osx-arm64::c-ares-1.24.0-h93a5062_0
ca-certificates conda-forge/osx-arm64::ca-certificates-2023.11.17-hf0a4a13_0
certifi conda-forge/noarch::certifi-2023.11.17-pyhd8ed1ab_0
contourpy conda-forge/osx-arm64::contourpy-1.2.0-py39he9de807_0
cycler conda-forge/noarch::cycler-0.12.1-pyhd8ed1ab_0
fonttools conda-forge/osx-arm64::fonttools-4.47.0-py39h17cfd9d_0
freetype conda-forge/osx-arm64::freetype-2.12.1-hadb7bae_2
geos conda-forge/osx-arm64::geos-3.12.1-h965bd2d_0
importlib-resourc~ conda-forge/noarch::importlib-resources-6.1.1-pyhd8ed1ab_0
importlib_resourc~ conda-forge/noarch::importlib_resources-6.1.1-pyhd8ed1ab_0
kiwisolver conda-forge/osx-arm64::kiwisolver-1.4.5-py39hbd775c9_1
krb5 conda-forge/osx-arm64::krb5-1.21.2-h92f50d5_0
lcms2 conda-forge/osx-arm64::lcms2-2.16-ha0e7c42_0
lerc conda-forge/osx-arm64::lerc-4.0.0-h9a09cb3_0
libblas conda-forge/osx-arm64::libblas-3.9.0-20_osxarm64_openblas
libbrotlicommon conda-forge/osx-arm64::libbrotlicommon-1.1.0-hb547adb_1
libbrotlidec conda-forge/osx-arm64::libbrotlidec-1.1.0-hb547adb_1
libbrotlienc conda-forge/osx-arm64::libbrotlienc-1.1.0-hb547adb_1
libcblas conda-forge/osx-arm64::libcblas-3.9.0-20_osxarm64_openblas
libcurl conda-forge/osx-arm64::libcurl-8.5.0-h2d989ff_0
libcxx conda-forge/osx-arm64::libcxx-16.0.6-h4653b0c_0
libdeflate conda-forge/osx-arm64::libdeflate-1.19-hb547adb_0
libedit conda-forge/osx-arm64::libedit-3.1.20191231-hc8eb9b7_2
libev conda-forge/osx-arm64::libev-4.33-h93a5062_2
libffi conda-forge/osx-arm64::libffi-3.4.2-h3422bc3_5
libgfortran conda-forge/osx-arm64::libgfortran-5.0.0-13_2_0_hd922786_1
libgfortran5 conda-forge/osx-arm64::libgfortran5-13.2.0-hf226fd6_1
libjpeg-turbo conda-forge/osx-arm64::libjpeg-turbo-3.0.0-hb547adb_1
liblapack conda-forge/osx-arm64::liblapack-3.9.0-20_osxarm64_openblas
libnghttp2 conda-forge/osx-arm64::libnghttp2-1.58.0-ha4dd798_1
libopenblas conda-forge/osx-arm64::libopenblas-0.3.25-openmp_h6c19121_0
libpng conda-forge/osx-arm64::libpng-1.6.39-h76d750c_0
libsqlite conda-forge/osx-arm64::libsqlite-3.44.2-h091b4b1_0
libssh2 conda-forge/osx-arm64::libssh2-1.11.0-h7a5bd25_0
libtiff conda-forge/osx-arm64::libtiff-4.6.0-ha8a6c65_2
libwebp-base conda-forge/osx-arm64::libwebp-base-1.3.2-hb547adb_0
libxcb conda-forge/osx-arm64::libxcb-1.15-hf346824_0
libzlib conda-forge/osx-arm64::libzlib-1.2.13-h53f4e23_5
llvm-openmp conda-forge/osx-arm64::llvm-openmp-17.0.6-hcd81f8e_0
matplotlib-base conda-forge/osx-arm64::matplotlib-base-3.7.3-py39h6685e7c_0
munkres conda-forge/noarch::munkres-1.1.4-pyh9f0ad1d_0
ncurses conda-forge/osx-arm64::ncurses-6.4-h463b476_2
numpy conda-forge/osx-arm64::numpy-1.26.2-py39heee92a0_0
openjpeg conda-forge/osx-arm64::openjpeg-2.5.0-h4c1507b_3
openssl conda-forge/osx-arm64::openssl-3.2.0-h0d3ecfb_1
packaging conda-forge/noarch::packaging-23.2-pyhd8ed1ab_0
pillow conda-forge/osx-arm64::pillow-10.1.0-py39h755f0b7_0
pip conda-forge/noarch::pip-23.3.2-pyhd8ed1ab_0
proj conda-forge/osx-arm64::proj-9.3.1-h93d94ba_0
pthread-stubs conda-forge/osx-arm64::pthread-stubs-0.4-h27ca646_1001
pyparsing conda-forge/noarch::pyparsing-3.1.1-pyhd8ed1ab_0
pyproj conda-forge/osx-arm64::pyproj-3.6.1-py39hd1c2dfb_5
pyshp conda-forge/noarch::pyshp-2.3.1-pyhd8ed1ab_0
python conda-forge/osx-arm64::python-3.9.18-hd7ebdb9_1_cpython
python-dateutil conda-forge/noarch::python-dateutil-2.8.2-pyhd8ed1ab_0
python_abi conda-forge/osx-arm64::python_abi-3.9-4_cp39
readline conda-forge/osx-arm64::readline-8.2-h92ec313_1
setuptools conda-forge/noarch::setuptools-68.2.2-pyhd8ed1ab_0
six conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
sqlite conda-forge/osx-arm64::sqlite-3.44.2-hf2abe2d_0
tk conda-forge/osx-arm64::tk-8.6.13-h5083fa2_1
tzdata conda-forge/noarch::tzdata-2023d-h0c530f3_0
unicodedata2 conda-forge/osx-arm64::unicodedata2-15.1.0-py39h0f82c59_0
wheel conda-forge/noarch::wheel-0.42.0-pyhd8ed1ab_0
xorg-libxau conda-forge/osx-arm64::xorg-libxau-1.0.11-hb547adb_0
xorg-libxdmcp conda-forge/osx-arm64::xorg-libxdmcp-1.1.3-h27ca646_0
xz conda-forge/osx-arm64::xz-5.2.6-h57fd34a_0
zipp conda-forge/noarch::zipp-3.17.0-pyhd8ed1ab_0
zstd conda-forge/osx-arm64::zstd-1.5.5-h4f39d0f_0
Downloading and Extracting Packages
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate msc39
#
# To deactivate an active environment, use
#
# $ conda deactivate
And then a simple import test:
(base) vic@alpha:~$ conda activate msc39
(msc39) vic@alpha:~$ python -c "from mpl_toolkits import basemap; print(basemap.__version__)"
1.3.9
I will be closing the issue, since we have conda
packages of basemap
1.3.9 for MacOS ARM64, and with basemap
1.4.0 I will be uploading the MacOS ARM64 wheels to PyPI too. Thanks for your help and feedback!
Hi, I tried to install Basemap via pip in Mac OS, but I have encountered an error. I also tried with another version (1.3.0), but those resulted in another error related to GEOS (it is installed and the environment variable is set correctly though).
Really appreciate your effort on this outstanding tool and thank you in advance for your support.
following is the log for installation of v 1.3.3:
$pip install basemap DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621 Collecting basemap Using cached basemap-1.3.3.zip (155 kB) Installing build dependencies ... error error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [553 lines of output] Ignoring numpy: markers 'python_version >= "3.10"' don't match your environment Ignoring numpy: markers 'python_version == "2.6" or (python_version >= "3.2" and python_version <= "3.3")' don't match your environment Ignoring cython: markers 'python_version == "3.2"' don't match your environment Collecting setuptools Downloading setuptools-63.4.1-py3-none-any.whl (1.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 7.2 MB/s eta 0:00:00 Collecting wheel Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB) Collecting numpy==1.16.6 Using cached numpy-1.16.6.zip (5.1 MB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting cython<3.1,>=0.29 Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB) Building wheels for collected packages: numpy Building wheel for numpy (setup.py): started Building wheel for numpy (setup.py): finished with status 'error' error: subprocess-exited-with-error
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
× pip subprocess to install build dependencies 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. WARNING: There was an error checking the latest version of pip.
And, following is NumPy info: $pip show numpy Name: numpy Version: 1.23.1 Summary: NumPy is the fundamental package for array computing with Python. Home-page: https://www.numpy.org Author: Travis E. Oliphant et al. Author-email: License: BSD Location: /usr/local/lib/python3.9/site-packages Requires: Required-by: cftime, h5py, matplotlib, netCDF4, pandas, ray, scipy, wradlib, xarray
Next is pip, and python versions: $pip -V pip 22.1.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)