【发布时间】:2020-11-05 03:41:23
【问题描述】:
我正在尝试安装一个名为 simpleHTTPServer 的模块,但无法安装,如下所述:
root@kali:~# pip install simpleHTTPServer
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
ERROR: Could not find a version that satisfies the requirement simpleHTTPServer (from versions: none)
ERROR: No matching distribution found for simpleHTTPServer
root@kali:~#
几个小时前我搞砸了我的 python2.7,因为我没有注意我在做什么.所以我删除了所有与python2.7有关的东西。然后我设法从官方网站下载了 python 2.7.18 并在 AS ROOT 下执行了这些命令:
cd /home/johnmap007/Downloads/Python-2.7.18
./configure
make
make install
python setup.py clean
python setup.py build
python setup.py install
然后我重新站起来跑步。 pip 开始工作正常,当我在 cmd 行中执行它时,python 给了我解释器。顺便说一句,我正在运行 Kali Linux。我尝试安装其他软件包,例如 scapy 并且它们有效。我不知道为什么我不能安装这个特定的包。任何帮助将不胜感激。提前致谢!
编辑:由于某种原因,当我运行 apt upgrade 时,我收到有关 python2.7 配置不正确的错误:
Setting up python2.7 (2.7.18-1) ...
/var/lib/dpkg/info/python2.7.postinst: 9: /usr/bin/python2.7: not found
dpkg: error processing package python2.7 (--configure):
installed python2.7 package post-installation script subprocess returned error exit status 127
Setting up sqlmap (1.4.11-1) ...
Installing new version of config file /etc/sqlmap/sqlmap.conf ...
Setting up libgstreamer-plugins-base1.0-0:amd64 (1.18.1-1) ...
Setting up libgstreamer-plugins-base1.0-0:i386 (1.18.1-1) ...
dpkg: dependency problems prevent configuration of python2:
python2 depends on python2.7 (>= 2.7.18~); however:
Package python2.7 is not configured yet.
dpkg: error processing package python2 (--configure):
dependency problems - leaving unconfigured
Setting up seclists (2020.4-0kali1) ...
Setting up libgstreamer-gl1.0-0:amd64 (1.18.1-1) ...
Setting up gstreamer1.0-plugins-base:amd64 (1.18.1-1) ...
Setting up gstreamer1.0-plugins-base:i386 (1.18.1-1) ...
Setting up python3-cryptography (3.2.1-1) ...
Setting up libsvn1:amd64 (1.14.0-3) ...
dpkg: dependency problems prevent configuration of python2.7-dev:
python2.7-dev depends on python2.7 (= 2.7.18-1); however:
Package python2.7 is not configured yet.
dpkg: error processing package python2.7-dev (--configure):
dependency problems - leaving unconfigured
Setting up gstreamer1.0-gl:amd64 (1.18.1-1) ...
Setting up gstreamer1.0-x:amd64 (1.18.1-1) ...
Setting up gstreamer1.0-x:i386 (1.18.1-1) ...
Setting up gstreamer1.0-alsa:amd64 (1.18.1-1) ...
dpkg: dependency problems prevent configuration of python2-dev:
python2-dev depends on python2 (= 2.7.18-2); however:
Package python2 is not configured yet.
python2-dev depends on python2.7-dev (>= 2.7.18~); however:
Package python2.7-dev is not configured yet.
dpkg: error processing package python2-dev (--configure):
dependency problems - leaving unconfigured
Setting up gir1.2-gst-plugins-base-1.0:amd64 (1.18.1-1) ...
Setting up subversion (1.14.0-3) ...
Processing triggers for kali-menu (2020.4.0) ...
Processing triggers for libc-bin (2.31-4) ...
Processing triggers for man-db (2.9.3-2) ...
Errors were encountered while processing:
python2.7
python2
python2.7-dev
python2-dev
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
我不知道发生了什么,我已经尝试运行 dpkg --configure -a。有人可以帮帮我吗?
【问题讨论】:
-
1) SimpleHttpServer 是内置的,没有理由安装它 2) 你为什么要使用 Python2?
标签: python python-2.7 pip