Hey. I had a problem installing basemap (a python package that is included in the matplotlib set for visualizing geodata). I love pip, so I decided to use it. As a result, I get about the same every time I start. I note that I install this package on python2.7. Response to command:

sudo pip2 install basemap

Collecting basemap Could not find a version that satisfies the requirement basemap (from versions:) No matching distribution found for basemap

The search for solutions led to the fact that dependencies that pip2, in theory, should resolve itself appear on the official basemap site , but for some reason did not resolve:

  • PROJ4 Cartographic Projections Library.
  • Geos
  • Pillow

GEOS was established by a separate command:

sudo pip2 install geos

All other friends, unfortunately, are not installed.

Direct installation from the repository also for some reason does not cure the situation. Some tips can be found here and here .

    2 answers 2

    I found the solution here .

    sudo apt-get install python-matplotlib

    sudo apt-get install python-mpltoolkits.basemap

    I note that initially, before installing basemap, the following actions can help:

    • Delete matplotlib and install again with the command I specified (not via pip)
    • Remove basemap, geos or any other package from the list above. After which you should install the basemap, as I have indicated.

    You can run a test case:

    from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt map = Basemap(projection='ortho', lat_0=50, lon_0=-100, resolution='l', area_thresh=1000.0) map.drawcoastlines() plt.show() 

    Result

      Because of the substrates bundled with Basemap, the package was considered too large to be placed on pypi.org. The link https://pypi.org/simple/basemap/ points to a file that does not contain links to archives.

      There are three ways to install the package.

      1. Install package from operating system repository
      2. Install package from Anaconda repository
      3. Install the package from source on github

      Basemap archives are stored on GitHub. The latest version can be found on the release page.

      It is necessary to install the header files of the GEOS library. After that, you can call pip by specifying a direct link to GitHub

       pip install https://github.com/matplotlib/basemap/archive/v1.1.0.tar.gz