【问题标题】:Python error E: Sub-process /usr/bin/dpkg returned an error code (1)?Python错误E:子进程/usr/bin/dpkg返回错误码(1)?
【发布时间】:2018-07-19 01:54:17
【问题描述】:

我试图安装“python-sklearn”,当我尝试安装任何 python 包时它需要很少的依赖项,它会显示类似这样的错误。我已经尝试了一些 prevoius 帖子建议的解决方案,但在我的情况下没有任何工作我该如何解决这个问题。

root@famous-breath:/home# sudo sudo apt-get install python-numpy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-numpy is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 34 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_IN"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up libblas3 (1.2.20110419-7) ...
update-alternatives: using /usr/lib/libblas/libblas.so.3 to provide /usr/lib/libblas.so.3 (libblas.so.3) in auto mode
update-alternatives: error: error creating symbolic link `/etc/alternatives/libblas.so.3.dpkg-tmp': No such file or directory
dpkg: error processing package libblas3 (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of liblapack3:
 liblapack3 depends on libblas3 | libblas.so.3; however:
  Package libblas3 is not configured yet.
  Package libblas.so.3 is not installed.
  Package libblas3 which provides libblas.so.3 is not configured yet.

dpkg: error processing package liblapack3 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-numpy:
 python-numpy depends on libblas3 | libblas.so.3; however:
  Package libblas3 is not configured yet.
  Package libblas.so.3 is not installed.
  Package libblas3 which provides libblas.so.3 is not configured yet.
 python-numpy depends on liblapack3 | liblapack.so.3; however:
  Package liblapack3 is not configured yet.
  Package liblapack.so.3 is not installed.
  Package liblapack3 which provides liblapack.so.3 is not configured yet.

dpkg: error processing package python-numpy (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libblas3
 liblapack3
 python-numpy
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@famous-breath:/home#

我尝试使用 apt 卸载 libblas3、liblapack3,但是当我添加新包时,它以错误代码 1 结尾,并且列表将显示该包

示例:

Errors were encountered while processing:
 libblas3
 liblapack3
 python-numpy
 python-matplotlib
 python-scipy
 python-sklearn-lib
 python-sklearn

请帮助我如何解决这个问题..

【问题讨论】:

    标签: python python-3.x ubuntu pip dpkg


    【解决方案1】:

    就我而言,我遇到了 python-faraday 的问题。

    Errors were encountered while processing:
    faraday
    python-faraday
    

    于是我查找了与之相关的文件:

    ls -l /var/lib/dpkg/info | grep -i faraday    
    -rw-r--r-- 1 root root   57089 Jun 30 09:49 faraday.list
    -rw-r--r-- 1 root root   65393 Jun 11 09:39 faraday.md5sum
    -rwxr-xr-x 1 root root    1968 Jun 11 09:39 faraday.postinst
    -rwxr-xr-x 1 root root     631 Jun 11 09:39 faraday.postrm`
    -rwxr-xr-x 1 root root     592 Jun 11 09:39 faraday.prerm
    -rw-r--r-- 1 root root   16980 Jun 30 09:45 python3-faraday-plugins.list
    -rw-r--r-- 1 root root   17054 Jun  8 14:56 python3-faraday-plugins.md5sums
    -rwxr-xr-x 1 root root     271 Jun  8 14:56 python3-faraday-plugins.postinst
    -rwxr-xr-x 1 root root     420 Jun  8 14:56 python3-faraday-plugins.prerm
    -rw-r--r-- 1 root root     334 Jun 30 13:38 python-faraday.list
    -rw-r--r-- 1 root root     387 Jun 11 09:39 python-faraday.md5sums
    

    现在我需要做的就是删除这些文件:

     sudo mv /var/lib/dpkg/info/polar-bookshelf.* /tmp
    

    使用 sudo apt update 然后你应该可以像往常一样安装软件了。

    【讨论】:

      【解决方案2】:
      Errors were encountered while processing:
      libblas3
      nliblapack3
      python-numpy
      python-matplotlib
      python-scipy
      python-sklearn-lib
      python-sklearn
      

      试试这个代码片段,它对我来说很好用!

      sudo mv /var/lib/dpkg/info/libblas3.postinst /var/lib/dpkg/info/libblas3.postinst.backup
      

      sudo mv /var/lib/dpkg/info/nliblapack3.postinst /var/lib/dpkg/info/nliblapack3.postinst.backup
      

      对所有导致错误的模块执行相同的操作。

      在您尝试使用更新缓存之后

      sudo apt-get update
      

      【讨论】:

        【解决方案3】:

        可能您的语言环境设置不正确。尝试运行以下命令:

        sudo locale-gen
        

        然后运行

        sudo dpkg --configure -a
        sudo apt-get install -f
        

        解决你的包的问题。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2022-07-17
          • 1970-01-01
          • 2020-02-10
          • 2015-08-21
          • 1970-01-01
          • 2019-03-09
          • 1970-01-01
          相关资源
          最近更新 更多