Open Prashant4900 opened 1 year ago
Hi,
Are you using an M1 or M2?
It's possible there's no compiled wheels available for this version of Python and your CPU's architecture so it needs to compile those dependencies and now certain dependencies are missing from the Dockerfile.
Switching to -binary
is problematic because it's a low performing package meant for easy development not production, it's also stated in their documentation:
The binary package is a practical choice for development and testing but in production it is advised to use the package built from sources.
We would need to hunt down the most minimal apt
package to install which provides pg_config
.
OS: Mac Book Air M1
Thanks for pointing this out. So what is the solution?
The proper fix would be to ask psycopg2 to compile a wheel for arm64 CPUs for Python 3.10+. They only have amd64 CPU wheels for Linux at https://pypi.org/project/psycopg2/#files.
In the mean time, the Dockerfile would need to be modified to install whatever dependencies it needs to be compiled. This one will be hard for me to test since I don't have an M1.
But:
We would need to hunt down the most minimal apt package to install which provides pg_config
I'm also really surprised this isn't a bigger issue. Lots of people use M1s.
Problem: Whenever I install packages from the requirements.txt file, it shows the error. Solution: After Changing the psycopg2 to psycopg2-binary the problem is fixed. OS: Mac