Apple Silicon psycopg2 installation work memo 2020/11/19
1, python3, pip3 use the one of os (Big Sur 11.1 beta) bundle
$ which python3 /usr/bin/python3
$ python3 -V Python 3.8.2
Avoid pip3 because it will give a warning if you call it directly alias pip3='/usr/bin/python3 -m pip'
$ pip3 -V pip 20.2.4 from /Users/myname/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)
2, install Postgresql
$ cd ~
$ wget https://ftp.postgresql.org/pub/source/v12.5/postgresql-12.5.tar.bz2
$ tar xvfz
I just want to use the library, so I don't create users
3, install Openssl $ cd ~ $ git clone git://git.openssl.org/openssl.git $ cd openssl $ vi Configurations/10-main.conf
1618 "darwin64-arm64-cc" => { inherit_from => [ "darwin64-arm64" ] }, # "His toric" alias 1619 "darwin64-arm64" => { 1620 inherit_from => [ "darwin-common" ], 1621 CFLAGS => add("-Wall"), 1622 cflags => add("-arch arm64"), 1623 lib_cppflags => add("-DL_ENDIAN"), 1624 bn_ops => "SIXTY_FOUR_BIT_LONG", 1625 asm_arch => 'aarch64_asm', 1626 perlasm_scheme => "macosx", <----- Rewrite here from ios to macosx 1627 },
$ ./Configure darwin64-arm64-cc --prefix="/usr/local/openssl-arm" $ make $ make test $ sudo make install
$ vi ~/.zshrc export LIBRARY_PATH=/usr/local/openssl-arm/lib:$LIBRARY_PATH $ source ~/.zshrc
4, install psycopg2 $ pip3 install psycopg2
that's all
Recommended Posts