Search code examples
pythonpython-3.xcartopypython-wheelpep

Cartopy python Package (PEP 517) wheel building


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


Solution

  • 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.