debian编译安装python_Debian8 下我想安装个 python3 的 pip,然而各种报错,完全不懂...

h19981126g

2018-08-11 11:14:32 +08:00

@likuku Traceback (most recent call last):

File "/usr/bin/apt-listchanges", line 28, in

import apt_pkg

ImportError: No module named 'apt_pkg'

Preconfiguring packages ...

(Reading database ... 41918 files and directories currently installed.)

Preparing to unpack .../libssl-dev_1.0.1t-1+deb8u9_amd64.deb ...

Unpacking libssl-dev:amd64 (1.0.1t-1+deb8u9) over (1.0.1t-1+deb8u8) ...

Preparing to unpack .../libssl1.0.0_1.0.1t-1+deb8u9_amd64.deb ...

Unpacking libssl1.0.0:amd64 (1.0.1t-1+deb8u9) over (1.0.1t-1+deb8u8) ...

Selecting previously unselected package libreadline6-dev:amd64.

Preparing to unpack .../libreadline6-dev_6.3-8+b3_amd64.deb ...

Unpacking libreadline6-dev:amd64 (6.3-8+b3) ...

Selecting previously unselected package libreadline-dev:amd64.

Preparing to unpack .../libreadline-dev_6.3-8+b3_amd64.deb ...

Unpacking libreadline-dev:amd64 (6.3-8+b3) ...

Selecting previously unselected package libsqlite3-dev:amd64.

Preparing to unpack .../libsqlite3-dev_3.8.7.1-1+deb8u2_amd64.deb ...

Unpacking libsqlite3-dev:amd64 (3.8.7.1-1+deb8u2) ...

Processing triggers for install-info (5.2.0.dfsg.1-6) ...

Setting up python-apt (0.9.3.12) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-apt (--configure):

subprocess installed post-installation script returned error exit status 1

dpkg: dependency problems prevent configuration of apt-listchanges:

apt-listchanges depends on python-apt (>= 0.7.93); however:

Package python-apt is not configured yet.

dpkg: error processing package apt-listchanges (--configure):

dependency problems - leaving unconfigured

Setting up python-ply (3.4-5) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-ply (--configure):

subprocess installed post-installation script returned error exit status 1

dpkg: dependency problems prevent configuration of python-pycparser:

python-pycparser depends on python-ply (>= 3.2); however:

Package python-ply is not configured yet.

python-pycparser depends on python-ply (<< 3.5) | python-ply-yacc-3.2; however:

Package python-ply is not configured yet.

Package python-ply-yacc-3.2 is not installed.

Package python-ply which provides python-ply-yacc-3.2 is not configured yet.

python-pycparser depends on python-ply-lex-3.2; however:

Package python-ply-lex-3.2 is not installed.

Package python-ply which provides python-ply-lex-3.2 is not configured yet.

dpkg: error processing package python-pycparser (--configure):

dependency problems - leaving unconfigured

dpkg: dependency problems prevent configuration of python-cffi:

python-cffi depends on python-pycparser; however:

Package python-pycparser is not configured yet.

dpkg: error processing package python-cffi (--configure):

dependency problems - leaving unconfigured

Setting up python-colorama (0.3.2-1) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-colorama (--configure):

subprocess installed post-installation script returned error exit status 1

Setting up libssl1.0.0:amd64 (1.0.1t-1+deb8u9) ...

Setting up libssl-dev:amd64 (1.0.1t-1+deb8u9) ...

dpkg: dependency problems prevent configuration of python-cryptography:

python-cryptography depends on python-cffi; however:

Package python-cffi is not configured yet.

dpkg: error processing package python-cryptography (--configure):

dependency problems - leaving unconfigured

Setting up python-distlib (0.1.9-1) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-distlib (--configure):

subprocess installed post-installation script returned error exit status 1

Setting up python-html5lib (0.999-3) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-html5lib (--configure):

subprocess installed post-installation script returned error exit status 1

dpkg: dependency problems prevent configuration of python-openssl:

python-openssl depends on python-cryptography; however:

Package python-cryptography is not configured yet.

dpkg: error processing package python-openssl (--configure):

dependency problems - leaving unconfigured

dpkg: dependency problems prevent configuration of python-ndg-httpsclient:

python-ndg-httpsclient depends on python-openssl; however:

Package python-openssl is not configured yet.

dpkg: error processing package python-ndg-httpsclient (--configure):

dependency problems - leaving unconfigured

Setting up python-urllib3 (1.16-1+deb8u1) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-urllib3 (--configure):

subprocess installed post-installation script returned error exit status 1

dpkg: dependency problems prevent configuration of python-requests:

python-requests depends on python-urllib3 (>= 1.16); however:

Package python-urllib3 is not configured yet.

python-requests depends on python-urllib3 (<< 1.16.1); however:

Package python-urllib3 is not configured yet.

dpkg: error processing package python-requests (--configure):

dependency problems - leaving unconfigured

Setting up python-setuptools (5.5.1-1) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-setuptools (--configure):

subprocess installed post-installation script returned error exit status 1

dpkg: dependency problems prevent configuration of python-pip:

python-pip depends on python-colorama; however:

Package python-colorama is not configured yet.

python-pip depends on python-distlib; however:

Package python-distlib is not configured yet.

python-pip depends on python-html5lib; however:

Package python-html5lib is not configured yet.

python-pip depends on python-requests; however:

Package python-requests is not configured yet.

python-pip depends on python-setuptools (>= 0.6c1); however:

Package python-setuptools is not configured yet.

dpkg: error processing package python-pip (--configure):

dependency problems - leaving unconfigured

Setting up python-pyasn1 (0.1.7-1) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-pyasn1 (--configure):

subprocess installed post-installation script returned error exit status 1

Setting up python-wheel (0.24.0-1) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 35, in

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

dpkg: error processing package python-wheel (--configure):

subprocess installed post-installation script returned error exit status 1

Setting up libreadline6-dev:amd64 (6.3-8+b3) ...

Setting up libreadline-dev:amd64 (6.3-8+b3) ...

Setting up libsqlite3-dev:amd64 (3.8.7.1-1+deb8u2) ...

Processing triggers for libc-bin (2.19-18+deb8u7) ...

Errors were encountered while processing:

python-apt

apt-listchanges

python-ply

python-pycparser

python-cffi

python-colorama

python-cryptography

python-distlib

python-html5lib

python-openssl

python-ndg-httpsclient

python-urllib3

python-requests

python-setuptools

python-pip

python-pyasn1

python-wheel

E: Sub-process /usr/bin/dpkg returned an error code (1)

如你所见的报错 No module named 'apt_pkg'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误通常是由于缺少一些依赖项或者环境配置不正确导致的。解决方法如下: 1. 确保你的Python环境已经正确安装并且可用。你可以通过运行`python --version`来检查Python版本。 2. 确保你的pip工具已经更新到最新版本。你可以运行以下命令来更新pip: ```shell python -m pip install --upgrade pip ``` 3. 确保你的网络连接正常,有时候下载依赖项需要联网。 4. 如果你使用的是虚拟环境,请确保你已经激活了虚拟环境。 5. 检查你的系统是否缺少一些必要的依赖项。根据错误信息中提到的路径`/tmp/pip-build-vKWv1h/pip/`,可能是pip自身的问题。你可以尝试重新安装pip: ```shell python -m pip uninstall pip python -m ensurepip --upgrade ``` 如果以上方法都没有解决问题,你可以尝试以下方法: 6. 检查你的系统是否缺少一些必要的库或者依赖项。根据错误信息中提到的路径`/tmp/pip-build-vKWv1h/pip/`,可能是缺少一些编译工具。你可以尝试安装一些常见的编译工具: - 在Debian/Ubuntu系统上,运行以下命令: ```shell sudo apt-get install build-essential ``` - 在CentOS/RHEL系统上,运行以下命令: ```shell sudo yum groupinstall 'Development Tools' ``` 7. 如果你使用的是MacOS系统,并且遇到了xgboost或lightGBM的安装问题,可以尝试使用Homebrew来安装依赖项: - 安装Homebrew,运行以下命令: ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` - 安装xgboost,运行以下命令: ```shell brew install xgboost ``` - 安装lightGBM,运行以下命令: ```shell brew install lightgbm ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值