Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/306.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 2.7在debian上安装pip?_Python_Pip_Debian_Virtualbox_Setuptools - Fatal编程技术网

如何使用python 2.7在debian上安装pip?

如何使用python 2.7在debian上安装pip?,python,pip,debian,virtualbox,setuptools,Python,Pip,Debian,Virtualbox,Setuptools,我读了很多网站和问题的答案,但我总是得到相同的错误,没有地方我找不到解决办法。 我的错误: 处理时出错: python error python crypto python wheel python pkg resources python-keyrings.alt ptho dbus python pip python xdg python secretstorage python keyring E:Sub-process/usr/bin/dpkg返回错误代码(1) 我将Python 2.7

我读了很多网站和问题的答案,但我总是得到相同的错误,没有地方我找不到解决办法。 我的错误:

处理时出错:
python error python crypto python wheel python pkg resources python-keyrings.alt ptho dbus python pip python xdg python secretstorage python keyring E:Sub-process/usr/bin/dpkg返回错误代码(1)

我将Python 2.7.13安装到/usr/src/Python2.7.13

有什么想法吗

编辑-贝米:

sudo apt-get update   -- done, working
sudo apt-get upgrade  -- not working, i get the errors what i wrote
sudo apt-get -f install -- not working, i get the errors what i wrote
web@debian:/usr/src/Python-2.7.13$ sudo dpkg --configure -a
Beállítás: python-crypto (2.6.1-7) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-crypto (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
Beállítás: python-wheel (0.29.0-2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-wheel (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
dpkg: error processing package python-pkg-resources (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of python-keyrings.alt:
 python-keyrings.alt függőségek: python-crypto; ám:
  python-crypto csomag még beállítatlan.

dpkg: error processing package python-keyrings.alt (--configure):
 függőségi hibák - e csomag beállítatlan maradt
Beállítás: python-dbus (1.2.4-1+b1) ...
Remove stale byte-compiled files...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-dbus (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
Beállítás: python-pip (9.0.1-2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-pip (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
Beállítás: python-xdg (0.25-4) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-xdg (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
dpkg: dependency problems prevent configuration of python-secretstorage:
 python-secretstorage függőségek: python-dbus; ám:
  python-dbus csomag még beállítatlan.

dpkg: error processing package python-secretstorage (--configure):
 függőségi hibák - e csomag beállítatlan maradt
dpkg: dependency problems prevent configuration of python-keyring:
 python-keyring függőségek: python-dbus; ám:
  python-dbus csomag még beállítatlan.
 python-keyring függőségek: python-secretstorage; ám:
  python-secretstorage csomag még beállítatlan.

dpkg: error processing package python-keyring (--configure):
 függőségi hibák - e csomag beállítatlan maradt
Hibák történtek a feldolgozáskor:
 python-crypto
 python-wheel
 python-pkg-resources
 python-keyrings.alt
 python-dbus
 python-pip
 python-xdg
 python-secretstorage
 python-keyring
我通过以下链接安装了Python 2.7.13:

编辑2-Beomi:

sudo apt-get update   -- done, working
sudo apt-get upgrade  -- not working, i get the errors what i wrote
sudo apt-get -f install -- not working, i get the errors what i wrote
web@debian:/usr/src/Python-2.7.13$ sudo dpkg --configure -a
Beállítás: python-crypto (2.6.1-7) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-crypto (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
Beállítás: python-wheel (0.29.0-2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-wheel (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
dpkg: error processing package python-pkg-resources (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of python-keyrings.alt:
 python-keyrings.alt függőségek: python-crypto; ám:
  python-crypto csomag még beállítatlan.

dpkg: error processing package python-keyrings.alt (--configure):
 függőségi hibák - e csomag beállítatlan maradt
Beállítás: python-dbus (1.2.4-1+b1) ...
Remove stale byte-compiled files...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-dbus (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
Beállítás: python-pip (9.0.1-2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-pip (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
Beállítás: python-xdg (0.25-4) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 26, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
dpkg: error processing package python-xdg (--configure):
 installed post-installation script alfolyamat 1 hibakóddal kilépett
dpkg: dependency problems prevent configuration of python-secretstorage:
 python-secretstorage függőségek: python-dbus; ám:
  python-dbus csomag még beállítatlan.

dpkg: error processing package python-secretstorage (--configure):
 függőségi hibák - e csomag beállítatlan maradt
dpkg: dependency problems prevent configuration of python-keyring:
 python-keyring függőségek: python-dbus; ám:
  python-dbus csomag még beállítatlan.
 python-keyring függőségek: python-secretstorage; ám:
  python-secretstorage csomag még beállítatlan.

dpkg: error processing package python-keyring (--configure):
 függőségi hibák - e csomag beállítatlan maradt
Hibák történtek a feldolgozáskor:
 python-crypto
 python-wheel
 python-pkg-resources
 python-keyrings.alt
 python-dbus
 python-pip
 python-xdg
 python-secretstorage
 python-keyring
web@debian:/usr/src/Python-2.7.13$sudo dpkg--configure-a
Beállítás:python加密(2.6.1-7)。。。
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pycompile”,第26行,在
导入日志记录
文件“/usr/lib/python2.7/logging/_init__uu.py”,第26行,在
导入系统、操作系统、时间、cStringIO、回溯、警告、weakref、集合
文件“/usr/lib/python2.7/weakref.py”,第14行,在
来自(u weakref import)(
导入错误:无法导入名称\u删除\u死亡\u weakref
dpkg:处理包python crypto(--configure)时出错:
安装后脚本alfolyamat 1 hibakóddal kilépett
贝里斯:巨蟒之轮(0.29.0-2)。。。
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pycompile”,第26行,在
导入日志记录
文件“/usr/lib/python2.7/logging/_init__uu.py”,第26行,在
导入系统、操作系统、时间、cStringIO、回溯、警告、weakref、集合
文件“/usr/lib/python2.7/weakref.py”,第14行,在
来自(u weakref import)(
导入错误:无法导入名称\u删除\u死亡\u weakref
dpkg:错误处理包python wheel(--configure):
安装后脚本alfolyamat 1 hibakóddal kilépett
dpkg:处理包python pkg资源时出错(--configure):
包处于非常糟糕的不一致状态;您应该
在尝试配置之前重新安装它
dpkg:依赖项问题阻止配置python-keyrings.alt:
python-keyrings.alt függőségek:python-crypto;ám:
python crypto csomag még beállítatlan。
dpkg:处理包python-keyrings.alt(--configure)时出错:
függőségi hibák-e csomag beállítatlan maradt
Beállítás:PythonDBUS(1.2.4-1+b1)。。。
删除过时的字节编译文件。。。
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pycompile”,第26行,在
导入日志记录
文件“/usr/lib/python2.7/logging/_init__uu.py”,第26行,在
导入系统、操作系统、时间、cStringIO、回溯、警告、weakref、集合
文件“/usr/lib/python2.7/weakref.py”,第14行,在
来自(u weakref import)(
导入错误:无法导入名称\u删除\u死亡\u weakref
dpkg:处理包python dbus(--configure)时出错:
安装后脚本alfolyamat 1 hibakóddal kilépett
贝里斯:python pip(9.0.1-2)。。。
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pycompile”,第26行,在
导入日志记录
文件“/usr/lib/python2.7/logging/_init__uu.py”,第26行,在
导入系统、操作系统、时间、cStringIO、回溯、警告、weakref、集合
文件“/usr/lib/python2.7/weakref.py”,第14行,在
来自(u weakref import)(
导入错误:无法导入名称\u删除\u死亡\u weakref
dpkg:处理包python pip(-configure)时出错:
安装后脚本alfolyamat 1 hibakóddal kilépett
贝里斯:python xdg(0.25-4)。。。
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pycompile”,第26行,在
导入日志记录
文件“/usr/lib/python2.7/logging/_init__uu.py”,第26行,在
导入系统、操作系统、时间、cStringIO、回溯、警告、weakref、集合
文件“/usr/lib/python2.7/weakref.py”,第14行,在
来自(u weakref import)(
导入错误:无法导入名称\u删除\u死亡\u weakref
dpkg:处理包python xdg(-configure)时出错:
安装后脚本alfolyamat 1 hibakóddal kilépett
dpkg:依赖关系问题阻止配置python secretstorage:
python secretstorage függőségek:python dbus;ám:
python dbus csomag még beállítatlan。
dpkg:处理包python secretstorage(--configure)时出错:
függőségi hibák-e csomag beállítatlan maradt
dpkg:依赖关系问题阻止配置python密钥环:
python密钥环függőségek:python dbus;ám:
python dbus csomag még beállítatlan。
python密钥环függőségek:python安全存储;ám:
python安全存储csomag még beállítatlan。
dpkg:处理包python keyring(--configure)时出错:
függőségi hibák-e csomag beállítatlan maradt
费尔多尔戈萨斯卡先生:
python加密
巨蟒轮
python pkg资源
python-keyrings.alt
python数据库总线
python pip
python xdg
python加密存储
python键环

因为你的问题不包括你到目前为止做了什么

那么,首先修复apt包怎么样

试试这个:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get -f install
然后用
sudo
再试一次

还有一点:如何使用
sudo apt get install python安装python

如果您真的需要最新版本的Python2.7,请告诉我们您的疑问/意见

如果不工作,请更新问题并评论plz

--更新--

由于
sudo-apt-get-upgrade
不起作用,我认为
PATH
、系统默认python与新安装的python之间可能存在问题

--更新--

这可能是debian iso文件的问题。

只需使用此文件即可

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-pip
查看此以了解更多信息

编辑:

也要检查。这一点很重要

编辑: 试试这个()

还有这个()


Python2.7中有一个名为get_pip.py的文件,您能运行该文件并检查目标机器中的python get_pip.py吗

sudo apt-get install libssl-dev &&
wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz &&
tar -xvf Python-2.7.13.tar.xz &&
cd Python-2.7.13 &&
./configure && sudo make && sudo make install

哪个python:我得到这个-->/usr/bin/pythonSo当你执行
python
时,它是系统默认的python,而不是你安装的python。让我再想想..你能告诉我
sudo dpkg--configure-a
的结果吗?你会尝试
sudo-apt-get-install--重新安装py吗