-
Notifications
You must be signed in to change notification settings - Fork 482
Description
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:
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:
cryptographynow 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
wheelallows pip to install precompiled binary wheels (.whlfiles)cryptographycontains C extensions that otherwise require compilation- installing
wheelensures 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.