OSError geos_c could not be found when Installing Shapely

前端 未结 6 531
星月不相逢
星月不相逢 2020-12-11 00:31

I\'m a newbie to making/plotting on maps with python, been trying to follow this blogpost to generate a world map (http://sciblogs.co.nz/seeing-data/2011/08/12/plotting-geog

相关标签:
6条回答
  • 2020-12-11 00:52

    I know it is a pretty old question but, as an alternative to https://stackoverflow.com/a/12683010/597743 you could use MacPorts to install the geos library:

    port install geos
    

    And the installation steps for MacPorts are described here: https://www.macports.org/install.php

    0 讨论(0)
  • 2020-12-11 00:59

    on windows 10, python 3.6.5 64bit

    • install osgeo4w
    • add installed folder to PATH e.g. C:\OSGeo4W64\bin (must contain geos_c.dll)
    • restart command line

    enjoy

    0 讨论(0)
  • 2020-12-11 01:04

    For questions 2-4, you have to have GEOS installed on your system. If you have homebrew you can do the following:

    brew install geos

    Install homebrew here if you don't have it: http://mxcl.github.com/homebrew/

    0 讨论(0)
  • 2020-12-11 01:04

    On Ubuntu, to install GEOS, this worked for me:

    $ sudo apt-get install libgeos-dev
    
    0 讨论(0)
  • 2020-12-11 01:10

    With OS X 10.11 (El Capitan) and Boxen, I had do do this:

    brew install geos
    sudo mkdir /opt/local
    sudo ln -s /opt/boxen/homebrew/lib /opt/local/lib
    

    to let Shapely find libgeos_c.dylib in one of the locations it was willing to look for it.

    0 讨论(0)
  • 2020-12-11 01:12

    The problem seems to be that you haven't actually installed the required modules.

    Lines of Python code like

    from mpl_toolkits.basemap import Basemap
    

    Are import statements that tell your script to use modules (or other bits of Python code) that you need to have already installed.

    For each of the packages mentioned (NumPy, Matplotlib, Basemap) you will have to figure out how to install them on your system. In the case of NumPy and Matplotlib this can be complicated because they require compilation. For instance these are theNumpy instructions.

    If you just wanted to try playing with the instructions in that blog post then you could use a service like PythonAnywhere which has numpy, matplotlib, and basemap installed already. (disclaimer, I work on PythonAnywhere...)

    0 讨论(0)
提交回复
热议问题