matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
774 stars 392 forks source link

Can't install 1.3.0 through python3 pip install #529

Closed DevAGCO closed 2 years ago

DevAGCO commented 2 years ago
python3 -m pip install https://github.com/matplotlib/basemap/archive/refs/tags/v1.3.0.zip
Collecting https://github.com/matplotlib/basemap/archive/refs/tags/v1.3.0.zip
  Downloading https://github.com/matplotlib/basemap/archive/refs/tags/v1.3.0.zip
     / 129.7 MB 8.7 MB/s
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-lvpffbrv/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-lvpffbrv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-lvpffbrv/pip-egg-info
         cwd: /tmp/pip-req-build-lvpffbrv/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.8/tokenize.py", line 392, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-lvpffbrv/setup.py'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
molinav commented 2 years ago

Hi @DevAGCO! This is a current known issue. A big package refactoring was done for v1.3.0 and now basemap is split in three parts: basemap, basemap-data and basemap-data-hires. As a consequence, v1.3.0.zip does not contain the setup.py file anymore at the top-level folder but at ./packages/basemap and pip does not know what to do.

Which platform and Python version are you using? It could be that you can take advantage of the new precompiled binary wheels that I uploaded to PyPI, so that you only need to do:

python3 -m pip install basemap

and, in case you also need the high-resolution datasets:

python3 -m pip install basemap-data-hires
molinav commented 2 years ago

If you want to install basemap from source, I checked that the following should also work:

python3 -m pip install https://github.com/matplotlib/basemap/archive/refs/tags/v1.3.0.zip#subdirectory=packages/basemap
DevAGCO commented 2 years ago

Hi @molinav ! Thank you so much for your prompt and complete answer. I have tested both solutions and it worked ! I'm using Ubuntu 20.04.3 LTS and python 3.8.10. Great job with the lib !