I tried to install basemap on google colab and run these commands:
!apt-get install libgeos-3.5.0
!apt-get install libgeos-dev
!pip install https://github.com/matplotlib/basemap/archive/master.zip
I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libgeos-3.5.0
E: Couldn't find any package by glob 'libgeos-3.5.0'
E: Couldn't find any package by regex 'libgeos-3.5.0'
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgeos-dev is already the newest version (3.6.2-1build2).
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
Collecting https://github.com/matplotlib/basemap/archive/master.zip
Using cached https://github.com/matplotlib/basemap/archive/master.zip
ERROR: File "setup.py" not found for legacy project https://github.com/matplotlib/basemap/archive/master.zip.
I then cannot import basemap:
>>> from mpl_toolkits.basemap import Basemap
ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
CodePudding user response:
There are a couple of errors here.
aptcannot findlibgeosE: Unable to locate package libgeos-3.5.0You may need to find another version of
libgeosthough I'm not sure what version. Perhaps this should match the installed dev version,3.6.2?pipcannot install using the archive that you are providing.ERROR: File "setup.py" not found for legacy project https://github.com/matplotlib/basemap/archive/master.zip.You can fix this by telling
pipspecifically what subdirectory it will find the package in:pip install git https://github.com/matplotlib/basemap#subdirectory=packages/basemapThis will allow
pipto find the correct package directory.
