Skip to content
This repository was archived by the owner on Dec 23, 2020. It is now read-only.

依赖包安装失败 #2

Closed
kiang70 opened this issue Sep 19, 2016 · 9 comments
Closed

依赖包安装失败 #2

kiang70 opened this issue Sep 19, 2016 · 9 comments

Comments

@kiang70
Copy link

kiang70 commented Sep 19, 2016

在执行pip install -r requirements.txt时抛出这个错误

`Using cached djangorestframework_word_filter-0.1.1-py2.py3-none-any.whl
Collecting psycopg2==2.6.2 (from -r requirements.txt (line 8))
Using cached psycopg2-2.6.2.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-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 manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found

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'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-bftx538c/psycopg2/
`
我的操作系统是kali2.0,我感觉是virtualenv的问题吧,kali2.0里自带python3.4,如果不用virtualenv,该怎么解决?求解答,感谢!

@0xbug
Copy link
Owner

0xbug commented Sep 19, 2016

@kiang70 apt-get install postgresql-server-dev-9.4或者9.5或者9.6,解决问题了吗?

@0xbug 0xbug closed this as completed Sep 20, 2016
@mvike
Copy link

mvike commented Sep 23, 2016

apt-get install postgresql-server-dev-9.4的时候也报错,提示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
postgresql-server-dev-9.4 : Depends: libpq-dev (>= 9.4~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
然后再安装 libpq-dev继续报错一路报到天荒地老。。。。KALI2.0伤不起

@0xbug
Copy link
Owner

0xbug commented Sep 23, 2016

@mvike 先 apt-get update ,然后优先安装最高版本试试

@kiang70
Copy link
Author

kiang70 commented Sep 25, 2016

我已经按照你给出的链接修改了更新源,执行apt-get install postgresql-server-dev-9.4,但仍然不行,抛出错误如下

(venv) root@kali:~/pentest/SQLiScanner# apt-get install postgresql-server-dev-9.4
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:

下列软件包有未满足的依赖关系:
postgresql-server-dev-9.4 : 依赖: libpq-dev (>= 9.4~) 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。

@mvike
Copy link

mvike commented Sep 26, 2016

@0xbug 已解决,用aptitude可以完成安装依赖包的问题

@ruby-ex
Copy link

ruby-ex commented Oct 4, 2016

@kiang70

apt-get install libpq-dev python3-dev

要在Django下使用PostgreSQL,你需要在虚拟环境中安装psycopg2数据库适配器,这一步需要原生扩展编译,如果没法找到头文件、使用libpq(用来与Postgres通信的库)链接C程序的静态库和创建Python模块的python开发库(python-dev package),编译将会失败。所以我们必须先安装这些依赖包,然后才能使用PIP安装psycopg2

@I-was-a-fish
Copy link

我在执行python manage.py makemigrations scanner的时候提示ImportError: No module named timeutils。请问timeutils怎么安装 我用的是ubuntu python2.7

@0xbug
Copy link
Owner

0xbug commented Nov 16, 2016

@I-was-a-fish 暂不支持,请用 Python3.x 哦

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants