Cartopy python Package (PEP 517) wheel building

Question:

I am trying to make a program with tropycal but it shows a wheel building error for a package dependency. Called Cartopy.

Pip3 Error:

ERROR: Could not build wheels for cartopy which use PEP 517 and cannot be installed directly.

I tried a solution from another StackOverflow question:

pip3 install cartopy --no-binary :all:

But it takes full CPU Power (100) and increases the CPU’s temperature/thermal energy to 81 Celcius / 354.15 kelvin.

The Python version I am using is Python 3.8

I have Linux Mint

Asked By: ScienceAJ

||

Answers:

Try to get the wheel from Christoph Gohlke (link); search for cartopy and select the one for your version of Python (it looks like it is updated up to Python 3.10). Download the wheel and pip install, like:

pip install Cartopy‑0.20.2‑cp38‑cp38‑win_amd64.whl

(for Python 3.8)

Whereby the file Cartopy‑0.20.2‑cp38‑cp38‑win_amd64.whl is in the folder where you start the pip.

Answered By: Bruno Vermeulen

But it takes full CPU Power (100) and increases the CPU’s
temperature/thermal energy to 81 Celcius / 354.15 kelvin.

If the no-binary flag doesn’t work (as you described above), it can be due to cache issues.

Instead of pip3 install cartopy --no-binary :all: you may try pip3 install cartopy --no-cache-dir.

Another option would be to install the dependencies manually an then continue trying to install the package using pip. A list of the required dependencies can be found here.

Another approach which I found on various forums (such as this link) is to upgrade wheels first before re-trying the cartopy installation. This can be done via pip3 install --upgrade pip setuptools wheel!

As a last resort (and this should only be used if no other options work), you may go ahead and disable the PEP 517 flag: pip3 install cartopy --no-use-pep517. This will most likely result in a lower quality build of the cartopy package and thus is not suggested.

Answered By: J. M. Arnold