How can I get python packages to work on mac m1?

Viewed 1329

I am playing around with building an instagram bot using instapy, but I am getting the following error when trying to import instapy when using a Mac M1 chip.

ImportError: dlopen(/venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): tried: '/venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/cygrpc.cpython-310-darwin.so' (no such file)

I've actually been having a tough time with python packages recently after getting a mac m1. I can't seem to find anything on how to get some of these packages to work.

How can I resolve this issue and fix other packages that are having issues?

1 Answers

Python2 comes with MacOS, so pip install x may point towards Python2. Try the following:

pip3.10 install instapy
Related