Using Fabric on mac m1 chip

December 21, 2022 - by Themba Mahlangu - 1 min read

Fabric does work on the new M1 chips. This is related to the cryptography lib errors list on this

SO question

.

When you try to run
fab -l
for example, you will get an error that looks something like this.

Code
 text
Code
`ImportError: dlopen(/Users/themba/Teamcoda/teamcoda/moneyphone/moneyphone-backend-python/.venv/lib/python3.9/site-packages/_cffi_backend.cpython-39-darwin.so, 0x0002): Library not loaded: /usr/local/opt/libffi/lib/libffi.7.dylib
  Referenced from: <25D29055-9FAD-3C33-903B-0E3CC6A9DEC2> /Users/themba/Teamcoda/teamcoda/moneyphone/moneyphone-backend-python/.venv/lib/python3.9/site-packages/_cffi_backend.cpython-39-darwin.so
`

To fix it:

Code
 text
Code
`Uninstalling old cffi pip uninstall cffi
Upgrading pip python -m pip install --upgrade pip
Reinstalling cffi pip install cffi
Intalling cryptography pip install cryptography`

Happy coding.