peterkuma / ccplot

Command-line application for visualizing data from CloudSat and CALIPSO satellites
http://ccplot.org
Other
35 stars 7 forks source link

ImportError: cannot import name basemap #6

Closed krishnaap closed 4 years ago

krishnaap commented 4 years ago

I tried to install ccplot in Ubuntu 19.04, but it shows.

Traceback (most recent call last):
  File "/usr/local/bin/ccplot", line 53, in <module>
    from mpl_toolkits import basemap
ImportError: cannot import name basemap

But I already installed Basemap

peterkuma commented 4 years ago

Hi krishnaap,

Thank you for reporting the bug. It looks like Ubuntu 19.04 no longer offers basemap as a Python 2.7 package. It can be installed manually with:

sudo apt-get install libgeos-dev python-pyproj
pip install --upgrade --user matplotlib
wget https://github.com/matplotlib/basemap/archive/v1.1.0.tar.gz
tar xf v1.1.0.tar.gz
cd basemap-1.1.0
python setup.py install --user

Hopefully it will work on your system, it can sometimes get complicated if multiple versions of packages are installed. A better solution would be if I update ccplot to support Python 3, but right now this solution is faster even if not ideal.

peterkuma commented 4 years ago

ccplot 1.5.4 adds support for Python 3, which means python3-mpltoolkits.basemap can be installed from the system repositories.