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. vim中ctags 的使用

    --- title: vim中ctags 的使用 EntryName: vim-config-with-ctags date: 2020-08-19 11:17:38 categories: tags ...

  2. Ubuntu 使用 SVN 管理 项目

    背景 公司的项目需要在 Linux 环境进行开发,而都是使用 SVN 进行管理的.习惯了 SVN-GUI 的我,需要学习 SVN 的命令行. 准备 安装 SVN sudo apt-get apt-ge ...

  3. 基于Mock.js,使用C#生成模拟数据

    获取某前端框架, 使用 Mock.js 生成模拟数据, 想要对api进行改造,并且保留原始数据,需要使用C# 重写后端api 的数据 模拟的内容: Random.guid() uuid: '@uuid ...

  4. 【资料分享】全志科技T507-H开发板规格书

    1 评估板简介 创龙科技TLT507-EVM是一款基于全志科技T507-H处理器设计的4核ARM Cortex-A53国产工业评估板,主频高达1.416GHz,由核心板和评估底板组成.核心板CPU.R ...

  5. 使用sqlcel导入数据时出现“a column named '***' already belongs to this datatable”问题的解决办法

    我修改编码为GBK之后,选择导入部分字段,如下: 这样就不会出现之前的问题了,完美 ----------------------------------------------- 但是出现一个问题,我 ...

  6. WPF单行TextBox自动滚动至末尾

    根据光标位置自动滚动 textBox.CaretIndex = textBox.SelectionStart; var rect = textBox.GetRectFromCharacterIndex ...

  7. Eggjs 设置跨域请求 指定地址跨域 nodejs

    首先egg自身框架没有直接设置允许跨域请求的功能和接口,所以需要第三方包来设置跨域请求! 先安装第三方包来设置跨域,使用egg-cors // npm npm i egg-cors --save // ...

  8. WPF/C#:在WPF中如何实现依赖注入

    前言 本文通过 WPF Gallery 这个项目学习依赖注入的相关概念与如何在WPF中进行依赖注入. 什么是依赖注入 依赖注入(Dependency Injection,简称DI)是一种设计模式,用于 ...

  9. Java-继承Thread的方式和实现Runnable接口多线程

    继承Thread的方式实现多线程 public class TestThread extends Thread{ @Override public void run() { System.out.pr ...

  10. 2024 年 Visual Studio 实用插件集合

    前言 在软件开发领域,选择正确的工具可以极大地提升开发效率和质量. Visual Studio作为微软推出的强大集成开发环境(IDE),通过安装合适的插件,可以进一步增强其功能,满足开发者多样化的需求 ...