如何在 kali-linux 上安装 psycopg2?
Posted
技术标签:
【中文标题】如何在 kali-linux 上安装 psycopg2?【英文标题】:how to install pyscopg2 on kali-linux? 【发布时间】:2019-11-24 05:41:34 【问题描述】:我正在尝试在 kali-linux 上安装 pyscopg2 安装 postgresql 后我试过了:
$ sudo pip3 install pyscopg2
我得到以下信息:
ERROR: Complete output from command python setup.py egg_info:
ERROR: running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
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'
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-_hg2dt6y/psycopg2/
1) 我试过了:
$ sudo pip3 install postgresql-server-dev-X.Y
我得到以下信息:
ERROR: Could not find a version that satisfies the requirement postgresql-server-dev-X.Y (from versions: none)
ERROR: No matching distribution found for postgresql-server-dev-X.Y
我希望安装 pyscopg2。
【问题讨论】:
X.Y 是占位符... You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application的可能重复 【参考方案1】:在 Ubuntu 18 中, 先安装依赖 -
sudo apt-get install libpq-dev python3-dev
然后去你的环境安装——
sudo pip install psycopg2
【讨论】:
以上是关于如何在 kali-linux 上安装 psycopg2?的主要内容,如果未能解决你的问题,请参考以下文章