Install psycopg2 (pgsql library for python3) on Apple Silicon

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 $ cd pgsql $ ./configure $ make $ sudo make install $ vi ~/.zshrc export PATH=/usr/local/pgsql/bin:$PATH

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

Install psycopg2 (pgsql library for python3) on Apple Silicon
Install confluent-kafka for Python on Ubuntu
Install python library on Lambda using [/ tmp]
Install Python and libraries for Python on MacOS Catalina
Install python on WSL
Install Python on Pidora.
Install Scrapy on python3
Install Python on Mac
Install Python 3 on Mac
Install Python3.4 on CentOS 6.6
Install python external library
Install python on windows
Install Python 2.7.3 on CentOS 5.4
Install Python 3.3 on Ubuntu 12.04
Install Python 3.4 on Mac
Install Python 3.6 on Docker
Install Python (for Windows)
Install the 3rd party python library on Cinema 4D
Compile and install MySQL-python for python2.7 on amazon linux
For those who can't install Python on Windows XP
Install PyCall on Raspberry PI and try using GPIO's library for Python from Ruby
Install Python 3.8 on RHEL 8 (AppStream)
Install watchdog on Windows + Python 3.3
Install pygame on python3.4 on mac
Windows10: Install python dlib library
Install Python 3.8 on CentOS 7 (SCL)
Install pandas 0.14 on python3.4 [on Mac]
Install OpenCV on Ubuntu + python
Python --Install MySQLDB on EC2
Install Python 3.8 on CentOS 8 (AppStream)
[Python] [Chainer] [Windows] Install Chainer on Windows
Install dlib for Python (Windows)
Install python3 and scientific calculation library on Ubuntu (virtualenv + pip)
Install Python Pillow on Amazon Linux
Install Python 3.8 on Ubuntu 18.04 (OS standard)
Install Cheminformatics Tool RDKit for Python
Install Python3 on Sakura server (FreeBSD)
Install anaconda on Mac → Add Library
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Install python2.7 on windows 32bit environment
Install xgboost (python version) on Windows
Install Python on Windows + pip + virtualenv
Install Pytorch on Blender 2.90 python on Windows
Install Python 3.7 Anaconda on MAC, but Python 2
Install python3 on Mac (El Capitan)
Windows10: Install MeCab library in python
<For beginners> python library <For machine learning>
Install Python 3.9 on Ubuntu 20.04 (OS standard?)
Install Python development environment on Windows 10
Install Python on CentOS using Pyenv
Install Python 2.7 on Ubuntu 20.04 (OS standard?)
Steps to install python3 on mac
Install Python on CentOS using pyenv
Notes for using OpenCV on Windows10 Python 3.8.3.
[google-oauth] [python] Google APIs Client Library for Python
Solution for pip install error [Python] [Mac]
[Kivy] How to install Kivy on Windows [Python]
Notes on nfc.ContactlessFrontend () for nfcpy in python
Steps to install Python environment on Ubuntu
[Python] Register your own library on PyPI
scipy stumbles with pip install on python 2.7.8