Pip install return error - 3_project_codebasics_q_and_a
Whe i run "pip3 install -r requirements.txt " it throws error "ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them. pyarrow>=4.0 from https://files.pythonhosted.org/packages/88/7a/0da93a3eaaf251a30e32f3221e874263cdcd366c2cd6b7c05293aad91152/pyarrow-19.0.0-cp311-cp311-macosx_12_0_x86_64.whl (from streamlit==1.22.0->-r requirements.txt (line 3)): Expected sha256 ce42275097512d9e4e4a39aade58ef2b3798a93aa3026566b7892177c266f735 Got 05e9c0ca2e7e54e3a5cdec76f8b10a65dc09e9a29fea23a3d1c00239104d5a6d"
Steps to Fix the Issue The error specifies that pyarrow>=4.0 was downloaded, but its hash (05e9c0ca...) doesn't match the expected hash (ce422750...) from your requirements.txt. This mismatch suggests either the file has changed since the hash was generated, or your requirements.txt has outdated hash values. Verify Your requirements.txt Open your requirements.txt file and look for the line referencing pyarrow. It might look something like this:
pyarrow>=4.0 --hash=sha256:ce42275097512d9e4e4a39aade58ef2b3798a93aa3026566b7892177c266f735
The --hash option ensures package integrity by checking the downloaded file against this value. If the package was updated (e.g., to version 19.0.0), the hash in your file might correspond to an older version.
Update the Package and Hashes
If you intentionally want to use the latest pyarrow (like 19.0.0), you need to update the hash in requirements.txt to match the downloaded file.
To regenerate the hashes:
Remove the --hash part from the pyarrow line in requirements.txt temporarily (e.g., change it to just pyarrow>=4.0).
pip3 install -r requirements.txt
Then, use pip hash to generate the new hash for the downloaded package: bash
pip3 install pipdeptree # If you don't have it installed
pip3 freeze | pipdeptree -r | grep pyarrow
This will show the exact version installed (e.g., pyarrow==19.0.0).
Then:
pip3 download pyarrow==19.0.0
After downloading, check the hash manually or update requirements.txt with the new hash