Ask coding questions

← Back to all posts
EnvCommandError when installing package
maxbesong (2)

I'm attempting to add the Cartopy package for a Python script I'm writing. When I search for it in the "Packages" menu on the left side, I can find it there. But when I click the "+" button to add it, I get the error in the screenshot below.

I'm new to using packages in Python (mainly just used Matplotlib prior to this, and I didn't need to actually search for it in the packages menu, so this part is new to me). Is there a way I can get this package added to my project?

Answered by AntarcticaAdv (36) [earned 5 cycles]
View Answer
AntarcticaAdv (36)

Cartopy is a bit complex, it requires some native packages before it can be installed. Switch to the Shell tab next to Console and run install-pkg libproj-dev libgeos-dev. Once that is done try installing Cartopy again.

maxbesong (2)

@AntarcticaAdv Thank you very much--Cartopy was added with no issues after following your advice.

If anyone reads this in the future, I encountered a segmentation fault error when running a script with Cartopy. This was fixed after following the instructions here: