Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Can';t使用pip2.7安装simpleHTTPServer之类的软件包_Python_Python 2.7_Pip - Fatal编程技术网

Python Can';t使用pip2.7安装simpleHTTPServer之类的软件包

Python Can';t使用pip2.7安装simpleHTTPServer之类的软件包,python,python-2.7,pip,Python,Python 2.7,Pip,我正在尝试安装名为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

我正在尝试安装名为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:~#
几个小时前,我不小心删除了/usr/bin中的(rm)python2.7文件,而不是用mv重命名了它,从而把我的python2.7搞砸了,因为我没有注意到我在做什么。所以我删除了所有与python2.7有关的内容。然后,我从官方网站下载了python 2.7.18,并以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升级时,我发现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了。有人能帮我吗?

在标准库中,所以您不需要安装任何东西

你可以从

python -m SimpleHTTPServer
但是无论如何,你应该使用Python3,在它被重命名的地方

python3 -m http.server 
我删除了所有与python2.7有关的内容


此时您正在修改操作系统文件,而Kali Linux使用Python不仅仅是为了编写脚本。但是基于
/usr/bin/python2.7:notfound
,您可以开始对文件进行符号链接,以至少修复标准库中的错误,因此无需安装任何东西

你可以从

python -m SimpleHTTPServer
但是无论如何,你应该使用Python3,在它被重命名的地方

python3 -m http.server 
我删除了所有与python2.7有关的内容

此时您正在修改操作系统文件,而Kali Linux使用Python不仅仅是为了编写脚本。但是基于
/usr/bin/python2.7:not found
,您可以开始对文件进行符号链接,以至少修复该错误1)SimpleHttpServer是内置的,没有理由安装它2)为什么要使用python2?1)SimpleHttpServer是内置的,没有理由安装它2)为什么要使用python2?