How to Install the Basemap and the GEOS Library?

  • Context: Python 
  • Thread starter Thread starter ecastro
  • Start date Start date
  • Tags Tags
    install Python
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
6 replies · 14K views
ecastro
Messages
249
Reaction score
8
I have been following this procedure on installing the basemap and the GEOS library: https://matplotlib.org/basemap/users/installing.html

I have searched through other alternatives, but they seem to provide the same procedure. I need help on understanding the "Installation" process. I am using Python 3.6.1 on Windows 10.
 
Physics news on Phys.org
ecastro said:
I have been following this procedure on installing the basemap and the GEOS library: https://matplotlib.org/basemap/users/installing.html

I have searched through other alternatives, but they seem to provide the same procedure. I need help on understanding the "Installation" process. I am using Python 3.6.1 on Windows 10.
Which part are you having trouble with?
 
I have trouble specifically on the third step, but I am not sure.

I have 'matplotlib' and 'numpy' installed in my Python, but I don't know how to install the 'PROJ4' item under the requirements (however, I did not see this item on other references), so I am not sure if I am already done on the first step of the 'Installation' process, i.e. "Install pre-requisite requirements.". I had downloaded the basemap-tar file and extracted it, and I guess the "cd to the basemap-X.Y.Z directory" means that I need to open a command prompt inside the directory of the basemap folder. The third step says "Install the GEOS library", but I don't know how. The step shows that I need the command prompt to be go inside the 'geos-3.3.3' folder, which I did and then 'export GEOS_DIR=</usr/local/>', but the command prompt doesn't seem to process this line, it just says that the syntax of the command is incorrect.
 
ecastro said:
then 'export GEOS_DIR=</usr/local/>'
I don't believe you're supposed to type the angle brackets or the quotes.

Install the GEOS library. If you already have it on your system, just set the environment variable GEOS_DIR to point to the location of libgeos_c and geos_c.h (if libgeos_c is in /usr/local/lib and geos_c.h is in /usr/local/include, set GEOS_DIR to /usr/local). Then go to next step. If you don’t have it, you can build it from the source code included with basemap by following these steps:
I would look to see if the GEOS library is already installed. If it is, you don't need to to the export step.
 
I also tried it without the brackets and it said that the 'export' syntax is undefined.

How do I know if it is installed?
 
This is a command to export an environment variable under Linux. Windows doesn't know this command. I'm not familiar with this modules, but it seems that you need a compiler for it.

With Windows it's often better to use this Scientific Python Distributions with their own package manager like Anaconda: https://anaconda.org/anaconda/basemap