psycopg2 库是 python 用来操作 postgreSQL 数据库的第三方库。

执行:pip3 install psycopg2==2.8.4

有可能会报错:

Collecting psycopg2==2.8.4
Downloading https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz (377kB)
100% |████████████████████████████████| 378kB 1.1MB/s
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'project_urls'
warnings.warn(msg)
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: manifest_maker: standard file '-c' not found Error: pg_config executable not found. pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option: python setup.py build_ext --pg-config /path/to/pg_config build ... or with the pg_config option in 'setup.cfg'. If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead. For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>). ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-txs3m3mb/psycopg2/

解决方法

sudo apt-get install postgresql
sudo apt-get install python-psycopg2
sudo apt-get install libpq-dev
pip3 install psycopg2==2.8.4

ubuntu 安装psycopg2包的更多相关文章

  1. linux下查看某软件是否已安装, ubuntu安装deb包

    1.rpm包安装的,可以用rpm -qa看到,如果要查找某软件包是否安装,用 rpm -qa | grep “软件或者包的名字”. [root@hexuweb102 ~] rpm -qa | grep ...

  2. Ubuntu --- 安装deb包

    在Ubuntu下安装deb包需要使用dpkg命令.Dpkg 的普通用法: 1.sudo dpkg -i <package.deb> 安装一个 Debian 软件包,如你手动下载的文件. 2 ...

  3. ubuntu安装deb包(dpkg)

    安装 sudo dpkg -i DEB_PACKAGE 卸载 sudo dpkg -r PACKAGE_NAME 重新配置已安装的包 Reconfigure an existing package 例 ...

  4. ubuntu安装rpm包

    ubuntu下的rpm包的安装方法 一般是不能够直接安装的,我们需要一个工具叫alien,先install它吧.然后按照下面择所需. 1.直接安装: alien -i -c filename.rpm ...

  5. ubuntu安装rpm包,deb包等各种包

    ubuntu下的各种包的安装方法 Ubuntu麒麟自带的包管理工具有apt-get,但是里面的软件包一般年代比较久远,源更新很慢,支持也很少.如果想安装一些比较新的包,可以尝试到PPA上去找找看,找到 ...

  6. ubuntu 安装Elasticsearch5.0(Debian包)

    通过Debian包安装Elasticsearch Elasticsearch的Debian包可以从downloaded from our website或APT repository 它可以用于在任何 ...

  7. Ubuntu下deb包的安装方法 (zz)

    Ubuntu下deb包的安装方法 分类: Ubuntu10使用技巧 2010-10-11 23:49 42969人阅读 评论(3) 收藏 举报 ubuntudebdebianlinux deb是deb ...

  8. ubuntu下deb包的安装方法

    ubuntu下deb包的安装方法 简介 deb是debian linus的安装格式,跟red hat的rpm非常相似,最基本的安装命令是:dpkg -i file.deb dpkg 是Debian P ...

  9. 【转】Ubuntu下deb包的安装方法

    [转]Ubuntu下deb包的安装方法 deb是debian linus的安装格式,跟red hat的rpm非常相似,最基本的安装命令是:dpkg -i file.deb dpkg 是Debian P ...

  10. ubuntu安装greenplum依赖包

    ubuntu安装greenplum的过程中有两个比较难找的包,特地写出来给大家分享一下: 错误提示1:configure: error: header file <ldap.h> is r ...

随机推荐

  1. QT学习:01 工程文件详解

    --- title: framework-cpp-qt-01-工程文件详解 EntryName: framework-cpp-qt-01-project-file date: 2020-04-08 1 ...

  2. 下载 Linux 内核的脚本

    介绍 在 类UNIX 环境下运行比较好(基于wget) 包括了 2.6 ~ 4.x 内核的地址. 5.x 因为 还在更新因此不做记录. 脚本下载地址: https://files.cnblogs.co ...

  3. 【ClickHouse】5:clickhouse集群部署

    背景介绍: 有三台CentOS7服务器安装了ClickHouse HostName IP 安装程序 程序端口 centf8118.sharding1.db 192.168.81.18 clickhou ...

  4. CF1862G 题解

    首先这个查询操作很迷,考虑先化简查询操作. 不难发现由于每次是加上一个逆的等差序列,因此一次操作完每个数与它的前驱之差一定会减少,因此加上等差序列的次数就等于全局每个数与它的前驱之差最大值. 又因为会 ...

  5. SpringBoot的知识点总结和常用注解

    SpringBoot 知识点总结 基础入门 基本介绍.基本特性.核心模块.版本选择.环境要求.安装集成.技快速开发接口.Maven Wrapper.Spring Boot CLl 配置管理 配置类.配 ...

  6. vb.net 实现excel导入的时候滚动显示导入的数据

    如果你想在 Excel 导入过程中滚动显示导入的数据,可以使用逐行读取 Excel 数据并在滚动窗口中显示. 在 VB.NET 中,你可以使用 Excel.Range 对象逐行读取 Excel 数据, ...

  7. oeasy教您玩转python - 007 - # 字符本质

    ​ 字符本质 回忆上次内容 hello world 不是从来就有的 来自于unix和c 虽然我们今天有各种先进的学习手段 最早的高级语言学习是从最早的那张打字机用纸的手写代码起源的 所以输出用的是 p ...

  8. oeasy教您玩转vim - 86 - # 外部命令external Command

    ​ 外部命令 external 回忆 上次研究的是global :[range]global/{pattern}/{command} range 是执行的范围 pattern 是搜索的模式 comma ...

  9. 最好用的截图工具,提取自QQ(带以截图搜图、ocr文字识别,截长图,贴图,色号等功能)

    背景 现在登录QQ比较少,手机的QQ已经具备ocr识别功能,但是电脑上不登陆QQ,微信的简单截图功能又不能进行ocr识别,对于想提取的文字特别麻烦,需要找别的工具去提取.机缘发现网络上这款提取自QQ的 ...

  10. 关于在windows系统下使用Linux子系统

    今天意外刷到一个短视频,介绍了如何在windows下方便的使用系统自带的Linux子系统,本人抱着好奇的心理,也因为最近碰到了只使用windows操作系统解决不了的问题,还有想到以后测试项目大概率也要 ...