(深度操做系统)Deepin、Ubuntu、Debian安装pytthon包psycopg2

 Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'html

ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-7n6622n7/psycopg2/python

解决方案:sql

 

1.pip install -U pip数据库

2.pipinstall pyscopg2-binaryapp

提早准备安装PostgreSQL数据库ide

sudo apt-get update
sudo apt-get install postgresql postgresql-client

安装完毕后,系统会建立一个数据库超级用户 postgres,密码为空sudo -i -u postgrespost

psqlui

二.实例:spa

一、建立一个数据库 mydb:postgresql

1

sudo -u postgres createdb -O root test

二、为数据库更名:

1

alter database mydb rename to mynewdb;

三、登陆数据库:

1

psql -U root -d test -h 127.0.0.1 -p 5432

 

 

 

转载参考:https://www.runoob.com/postgresql/postgresql-tutorial.html