2/28/2024 0 Comments Psycopg2 mac m1pyscopg2-binary needs to be installed in mac instead of psycopg2. To compile from sources you need a lot of prerequisites. I fixed the same problem in Mac BigSur 11.5.1 M1 following the tips of this thread in the next. So pip tried to compile from sources and failed. Left the same comment in discussion #270. psycopg2-binary 2.9.3 doesn't provide binary wheels for MacOS arm64 binary wheels for MacOS are only provided for Intel x86 64 bits. It is possible that you have a working compiler environment, but the psycopg2 package is not PEP 517 compliant and cannot be built by Poetry. OperationalError: connection failed: :18a0:6af2:b15d:b7c8), port 5432 failed: could not receive data from server: Connection refused This does not appear to be a Poetry issue - you will need a working C compiler and the relevant headers to build psycopg2 on your Mac in this case, as there are no prebuilt binaries. > 1 ~/Library/Python/3.11/lib/python/site-packages/psycopg/connection.py:728, in nnect(cls, conninfo, autocommit, prepare_threshold, row_factory, cursor_factory, context, **kwargs)ħ24 cls._connect_gen(conninfo, autocommit=autocommit), c psycopg/adapter_binary.c -o build/temp.macosx-12.5-arm64-3.9/psycopg/adapter_binary.In : Traceback (most recent call last) Gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=110017 -DHAVE_LO64=1 -I/Users/zonghan/PycharmProjects/envpython3.9/include -I/usr/local/include/python3.9 -I. django djangorestframework psycopg2-binary Share. This: from psycopg2.psycopg import does not make sense. I don't have an M1 mac, but I am trying to help another engineer with an M1 Mac. c psycopg/adapter_asis.c -o build/temp.macosx-12.5-arm64-3.9/psycopg/adapter_asis.o macos psycopg2 python-3.8 apple-m1 Share. The psycopg2-binary package is meant for beginners to start playing with Python and PostgreSQL without the need to meet the build requirements. Gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall "-DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=110017 -DHAVE_LO64=1 -I/Users/zonghan/PycharmProjects/envpython3.9/include -I/usr/local/include/python3.9 -I. pip install psycopg2-binary The docs note that. The solution that finally worked for me for installing not only psycopg2, but also other packages (e.g. It is possible that you have a working compiler environment, but the psycopg2 package is not PEP 517 compliant and cannot be built by Poetry. Using cached psycopg2-binary-2.8.6.tar.gz (384 kB)īuilding wheels for collected packages: psycopg2-binaryīuilding wheel for psycopg2-binary (setup.py). Hey I struggled with installing psycopg2 on the new Apple Mac M1. So I changed vscode terminal settings and vscode terminal runs import psycopg2 perfectly. (envpython3.9) kc-server % pip install psycopg2-binary=2.8.6 You gave me an idea to test run python in iterm2 (running rosetta) and it works So I digged deeper into vscode terminal and it turned out that rossetta wasn't running.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |