13

It is unclear to me how to install Matplotlib's Basemap on Windows. Maybe the question is straightforward, I need some help.

I followed this tutorial. As far as I understand, first, GEOS and PROJ4 should be installed, and lastly matplotlib-1.4.3.win-amd64-py2.7.exe should be executed.

I get stuck with GEOS. I downloaded source code of geos-3.5.0, "untarred" it, then I go to a Command Prompt, change directory to geos-3.5.0 and run this:

export d://test

but it does not work.

2
  • @Leb: I got errors. That's why I got stuck. Commented Oct 8, 2015 at 16:19
  • You didn't list any, you said you're stuck. Have you tried using whl package? Commented Oct 8, 2015 at 16:20

5 Answers 5

23

Use this download for basemap on Windows.

It worked for me:

pip install basemap-1.0.8-cp34-none-win_amd64.whl

Assuming you're in right directory of course.

Sign up to request clarification or add additional context in comments.

3 Comments

You're welcome. It also got Shapely if you need it. Very useful.
I know this is an old answer, but could you please elaborate on what you mean by "Assuming you're in right directory"? When I try to run the command, I get the error: ERROR: basemap‑1.2.2‑cp38‑cp38‑win_amd64.whl is not a valid wheel filename.
@Qwethm You need to run your command in the same folder as the basemap-1.0.8-cp34-none-win_amd64.whl file (i.e in your downloads folder).
3

This is the alternate solution that might useful for anaconda users

For only Anaconda Users, they can get it to install on the local machine through the following command:

conda install basemap

This will auto-install all required dependency packages.

Here also, Assuming that User are at the right directory to install any module.

Comments

1

I had the same issue as I pip installed and then conda installed and then had to do a clean install as dependencies were a mess.

At that time I solved my problem by using Google Colab and installing the following:

!apt-get install -q libgeos-3.5.0
!apt-get install -q libgeos-dev
!pip install -q https://github.com/matplotlib/basemap/archive/master.zip
!pip install -q pyproj==1.9.6

I would also recommend reading Importing-of-Basemap-in-Google-Colab as it helped with Colab installation.

Comments

0

while importing like (from mpl_toolkits.basemap import Basemap) I was getting error.

For me This Worked Like charm:

pip install basemap

2 Comments

Worked for me when everything else didn't ! I'm not found of pip command but i couldn't manage to install basemap with conda. Thank you !
you could try to install using this command conda install -c conda-forge basemap, but it will take quite some times for the machine to find the compatible version that match your current system. or may be you could try to use mamba...a bit faster than conda
0

Currently there is fastest way to install basemap using mamba. Infact, you can install any library from mamba. first thing to do you must install mamba, with this command; conda install mamba -n base -c conda-forge, then you can proceed installing basemap using the command mamba install basemap. After completion the installation, please set your path environment as PROJ_LIB in user variable and set your packages proj-7.2.0 location.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.