安装 pycurl 失败

安装 pycurl 失败

我使用该命令sudo apt-get install python-pycurl并得到了以下结果:

 $ sudo apt-get install python-pycurl 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pycurl is already the newest version (7.43.0.1-0.2).
The following packages were automatically installed and are no longer required:
  adobe-flash-properties-gtk gnome-software-common libappstream-glib8 libpython-all-dev libpython-dev libpython2.7-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  apport python-cryptography python-pil python-urllib3
Suggested packages:
  apport-gtk | apport-kde python-cryptography-doc python-cryptography-vectors python-pil-doc python-pil-dbg python-ntlm
  python-socks
The following packages will be upgraded:
  apport python-cryptography python-pil python-urllib3
4 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
15 not fully installed or removed.
Need to get 0 B/819 kB of archives.
After this operation, 374 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 227938 files and directories currently installed.)
Preparing to unpack .../apport_2.20.9-0ubuntu7.23_all.deb ...
/var/lib/dpkg/info/apport.prerm: /usr/bin/pyclean: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: warning: old apport package pre-removal script subprocess returned error exit status 126
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: /usr/bin/pyclean: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: error processing archive /var/cache/apt/archives/apport_2.20.9-0ubuntu7.23_all.deb (--unpack):
 new apport package pre-removal script subprocess returned error exit status 126
/var/lib/dpkg/info/apport.postinst: /usr/bin/pycompile: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: error while cleaning up:
 installed apport package post-installation script subprocess returned error exit status 126
Preparing to unpack .../python-cryptography_2.1.4-1ubuntu1.4_amd64.deb ...
/var/lib/dpkg/info/python-cryptography.prerm: /usr/bin/pyclean: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: warning: old python-cryptography package pre-removal script subprocess returned error exit status 126
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: /usr/bin/pyclean: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: error processing archive /var/cache/apt/archives/python-cryptography_2.1.4-1ubuntu1.4_amd64.deb (--unpack):
 new python-cryptography package pre-removal script subprocess returned error exit status 126
/var/lib/dpkg/info/python-cryptography.postinst: /usr/bin/pycompile: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: error while cleaning up:
 installed python-cryptography package post-installation script subprocess returned error exit status 126
Preparing to unpack .../python-pil_5.1.0-1ubuntu0.4_amd64.deb ...
/var/lib/dpkg/info/python-pil:amd64.prerm: /usr/bin/pyclean: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: warning: old python-pil:amd64 package pre-removal script subprocess returned error exit status 126
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: /usr/bin/pyclean: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: error processing archive /var/cache/apt/archives/python-pil_5.1.0-1ubuntu0.4_amd64.deb (--unpack):
 new python-pil:amd64 package pre-removal script subprocess returned error exit status 126
/var/lib/dpkg/info/python-pil:amd64.postinst: /usr/bin/pycompile: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: error while cleaning up:
 installed python-pil:amd64 package post-installation script subprocess returned error exit status 126
Preparing to unpack .../python-urllib3_1.22-1ubuntu0.18.04.2_all.deb ...
/var/lib/dpkg/info/python-urllib3.prerm: /usr/bin/pyclean: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: warning: old python-urllib3 package pre-removal script subprocess returned error exit status 126
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: /usr/bin/pyclean: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: error processing archive /var/cache/apt/archives/python-urllib3_1.22-1ubuntu0.18.04.2_all.deb (--unpack):
 new python-urllib3 package pre-removal script subprocess returned error exit status 126
No apport report written because MaxReports is reached already
                                                              /var/lib/dpkg/info/python-urllib3.postinst: /usr/bin/pycompile: /usr/bin/python2: bad interpreter: No such file or directory
dpkg: error while cleaning up:
 installed python-urllib3 package post-installation script subprocess returned error exit status 126
Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.20.9-0ubuntu7.23_all.deb
 /var/cache/apt/archives/python-cryptography_2.1.4-1ubuntu1.4_amd64.deb
 /var/cache/apt/archives/python-pil_5.1.0-1ubuntu0.4_amd64.deb
 /var/cache/apt/archives/python-urllib3_1.22-1ubuntu0.18.04.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

安装其他软件包时也可能出现同样的问题。我猜是 python2 依赖性的问题。你能帮忙吗?

谢谢!

答案1

如果你使用的是 python3,则使用pip3安装,这将自动安装必要的依赖项。如果不是,请使用pip

相关内容