. Advertisement .
..3..
. Advertisement .
..4..
One of the most common errors we see while trying to troubleshoot Django app deployment on AWS Lambda is the “ERROR: Could not build wheels for cryptography, which use PEP 517 and cannot be installed directly”. In this blog, we will discuss the error, how it can be easily reproduced, and how to fix it.
When Do You Get The Error “ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly”?
When getting started with cryptography, you may get the following error.
ERROR: Failed building wheel for cryptography
Running setup.py clean for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
How To Fix The Error “ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly”?
Option 1: Upgrade to version 2.8 of cryptography.
Simply open the file requirement.txt. Then, select version 2.8 or 2.9.2 for cryptography. After that, save the requirements.txt file and run:
pip install -r requirements.txt
Option 2: Delete cryptography in the requirement.txt file.
Simply access the requirements.txt file and look for cryptography.
cryptography==2.8
Then, delete the version and leave only cryptography in the requirements.txt file below.
cryptography
Now, run:
pip install -r requirements.txt
Option 3: Upgrading pip
The issue will be resolved by simply updating pip.
python -m pip install --upgrade pip
Option 4: Follow this guide
Excepting the solutions mentioned above, there is another solution for yoo to solve the error “ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly”. Let’s follow this guide:
TLDR;
Attempt utilizing cryptography==3.1.1
This is the details:
This occured on Python 3.9.0
on Windows 10
PC. You have the below in requirements.txt:
cryptography==2.8
You keep only anycodings pip cryptography in the requirements.txt file and remove the version, as shown below:
cryptography
Now, let’s save the requirements.txt and then then anycodings_pip run:
pip install -r requirements.txt
It has set up effectively. Then you freeze anycodings pip the requirements.txt by using the command below.
pip freeze > requirements.txt
Following that, anycodings pip with cryptography==3.1.1 was added to the requirements.txt file.
This method is very simple, right? However, it works flawlessly. It will make your error disappear and your program will run well without any errors. So, what are you waiting without applying it to get your desired results?
Conclusion
We hope you will enjoy our blog post on how to solve the bug “ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly“. Please leave a comment if you have any further questions or concerns regarding installing pip on your machine. Thank you for taking the time to read; we are always delighted anytime one of our pieces can give important information on this topic!
Read more
→ The Error “Cannot Be Resolved To A Variable” In Java – How To Fix It?
Leave a comment