Cartopy: Pip install fails on Google Colaboratory

Created on 24 Jul 2019  路  3Comments  路  Source: SciTools/cartopy

Description


Installing cartopy 0.17 fails on Google Colaboratory

!pip install Cartopy==0.17.0

Collecting Cartopy==0.17.0
  Using cached https://files.pythonhosted.org/packages/e5/92/fe8838fa8158931906dfc4f16c5c1436b3dd2daf83592645b179581403ad/Cartopy-0.17.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
ERROR: Command "/usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp3f2vj7z1" failed with error code 1 in /tmp/pip-install-oa06ww6s/Cartopy 

Code to reproduce

!pip install Cartopy==0.17.0

https://colab.research.google.com/drive/1yKFEVZ2ZPrhJRwv0FewRIwhhfAbDw0bS

Traceback

Collecting Cartopy==0.17.0
  Using cached https://files.pythonhosted.org/packages/e5/92/fe8838fa8158931906dfc4f16c5c1436b3dd2daf83592645b179581403ad/Cartopy-0.17.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
ERROR: Command "/usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp3f2vj7z1" failed with error code 1 in /tmp/pip-install-oa06ww6s/Cartopy 


Full environment definition

Operating system

Google Colab running Python 3.6.8
Linux b6210b371490 4.14.79+ #1 SMP Wed Dec 19 21:19:13 PST 2018 x86_64 x86_64 x86_64 GNU/Linux

Cartopy version

0.17.0 (latest)

conda list


pip list


installation Question

Most helpful comment

To install in Colab on Ubuntu using pip, you need to install the library dependencies:

!apt-get install -qq libgdal-dev libproj-dev

Then !pip install cartopy works.

All 3 comments

Was this ever resolved? I have the same issue then am offered to insert

!apt-get -qq install python-cartopy python3-cartopy
import cartopy

This installs the library, but the gui does not populate images.

When I try to bring in

pip install Cartopy==0.17.0

in a regular Jupyter Notebook, this is the error

ERROR: setup.py:171: UserWarning: Unable to determine GEOS version. Ensure you have 3.3.3 or later installed, or installation may fail.
'.'.join(str(v) for v in GEOS_MIN_VERSION), ))
Proj 4.9.0 must be installed

Thanks

I'm not sure what the listed dependencies are for python3-cartopy. What that error message indicates is that it's not finding Proj.4, so you need to install the system package for that, which may solve it. You might also check the Proj Installation Guide.

To install in Colab on Ubuntu using pip, you need to install the library dependencies:

!apt-get install -qq libgdal-dev libproj-dev

Then !pip install cartopy works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lzkelley picture lzkelley  路  4Comments

mjarrett picture mjarrett  路  5Comments

QuLogic picture QuLogic  路  6Comments

choldgraf picture choldgraf  路  3Comments

MarkWieczorek picture MarkWieczorek  路  9Comments