Search code examples
pythonmatplotlibanacondamatplotlib-basemap

Basemap with Python 3.5 Anaconda on Windows


I use Python 3.5 with latest version of Anaconda on Windows (64 bit). I wanted to install Basemap using conda install basemap. Apparently there is a conflict between Python 3 and basemap. After some googling indeed I found that basemap is not supported on Python 3 for Windows users (ex: https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/TjAwi3ilQaU).

For obvious reasons I do not want to downgrade to Python 2. What would then be the simplest alternative solution?

  • Is there an alternative package similar to basemap for ploting maps, etc.?
  • Should I use a second environment which uses Python 2 and basemap? I have never done that but it seems possible (http://conda.pydata.org/docs/py2or3.html). Is it "safe"? Should I install again all the other packages (matplotlib, numpy, etc.) on the second environment?

Thanks in advance for the help and advice.


Solution

  • I have solved this several times (last time just now) by downloading it from http://www.lfd.uci.edu/~gohlke/pythonlibs and follow the instructions to install. From the anaconda command prompt

    pip install full_path_to_package

    For example, if you downloaded basemap-1.1.0-cp36-cp36m-win_amd64.whl, you would run

    pip install C:\path\to\file\basemap-1.1.0-cp36-cp36m-win_amd64.whl

    Note that the python version of the .whl file must match your python version. For example, ...-cp36-.... indicates Python 3.6. You can find your python version by running the command python --version.