Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Deprecated --global-option installation command for cryptography still appears in documentation #1329

@piyush140104

Description

@piyush140104

Description

The documentation currently recommends installing cryptography using an outdated command such as:

pip install cryptography --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="-I/usr/local/opt/openssl/include"

Running this command now fails immediately — even before any build step begins — and results in the following error:

Image

Pip also prints additional errors, including:

  • failures when trying to install build dependencies
  • inability to satisfy modern requirements such as packaging >= 24.2
  • warnings that the pip version being used is outdated

After upgrading pip and installing cryptography without these legacy options, the installation succeeds normally.


Root Cause

This installation method relies on:

  • legacy setup.py install
  • passing compiler flags using --global-option

Modern pip versions do not support --global-option for PEP-517/518 builds.
cryptography also no longer uses setup.py, so these flags cannot be processed anymore.

Additionally:

  • cryptography now ships prebuilt wheels for modern platforms
  • manual OpenSSL include/library paths are no longer required

Because of these changes, this old installation command will always fail on current versions of pip.


Correct Modern Installation Steps

Upgrade pip, setuptools, and wheel:

pip install --upgrade pip setuptools wheel

Then install cryptography normally:

pip install cryptography


Why Installing wheel First Matters

  • wheel allows pip to install precompiled binary wheels (.whl files)
  • cryptography contains C extensions that otherwise require compilation
  • installing wheel ensures pip uses a prebuilt binary instead of building from source
  • this prevents compiler-related build errors and speeds up installation

After upgrading pip and using this modern installation process, cryptography installs cleanly and works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions