Cygwin: (python) ERROR: Failed building wheel for cryptography

Question:

I’m using cygwin to develop a django application. And I’m stuck at a package install call digikey-api.
It requires a cryptography package to be installed and it fails with the following error messages:

generating cffi module 'build/temp.cygwin-3.2.0-x86_64-3.8/_openssl.c'
running build_rust

    =============================DEBUG ASSISTANCE=============================
    If you are seeing a compilation error please try the following steps to
    successfully install cryptography:
    1) Upgrade to the latest pip and try again. This will fix errors for most
       users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
    2) Read https://cryptography.io/en/latest/installation.html for specific
       instructions for your platform.
    3) Check our frequently asked questions for more information:
       https://cryptography.io/en/latest/faq.html
    4) Ensure you have a recent Rust toolchain installed:
       https://cryptography.io/en/latest/installation.html#rust
    5) If you are experiencing issues with Rust for *this release only* you may
       set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
    =============================DEBUG ASSISTANCE=============================

error: can't find Rust compiler

If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

To update pip, run:

    pip install --upgrade pip

and then retry package installation.

If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.

This package requires Rust >=1.41.0.
----------------------------------------
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
(venv)

I’ve been trying various solution but no success so far (ie. pip install –upgrade pip did not solve the issue).
Funny this is that it fails in this python virtual env. but it is succesfull outside this environment (same python version 3.8.10).

thanks for any help getting around this.
Sebastien

Asked By: sebo

||

Answers:

The message is very clear

error: can't find Rust compiler

As Cygwin has NO rust compiler, you can not build it

https://cygwin.com/packages/package_list.html

Answered By: matzeri
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.