我可能完全搞砸了我的Python 2.7.3安装。我已经能够设置和运行Python 2.7.3,所有导入工作正常。
但是当我尝试安装python-dev时,我得到了这个:
ritwik@ritwik-pc:~$ sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
python-dev
0 upgraded, 1 newly installed, 0 to remove and 290 not upgraded.
5 not fully installed or removed.
Need to get 0 B/1,166 B of archives.
After this operation, 46.1 kB of additional disk space will be used.
Selecting previously unselected package python-dev.
(Reading database ... 168442 files and directories currently installed.)
Preparing to unpack .../python-dev_2.7.5-5ubuntu3_amd64.deb ...
Unpacking python-dev (2.7.5-5ubuntu3) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up python-colorama (0.2.5-0.1ubuntu1) ...
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
ImportError: No module named time
dpkg: error processing package python-colorama (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-distlib (0.1.8-1) ...
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
ImportError: No module named time
dpkg: error processing package python-distlib (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-html5lib (0.999-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
ImportError: No module named time
dpkg: error processing package python-html5lib (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-setuptools (3.3-1ubuntu1) ...
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
ImportError: No module named time
No apport report written because MaxReports is reached already
dpkg: error processing package python-setuptools (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-urllib3 (1.7.1-1build1) ...
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
ImportError: No module named time
dpkg: error processing package python-urllib3 (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Setting up python-dev (2.7.5-5ubuntu3) ...
Errors were encountered while processing:
python-colorama
python-distlib
python-html5lib
python-setuptools
python-urllib3
E: Sub-process /usr/bin/dpkg returned an error code (1)
正在运行which python
会/usr/bin/python
运行python --version
给出Python2.7.3
更新:apt-get codeblocks installed codeblocks
(工作,测试),但发出以下错误:
ritwik@ritwik-pc:~$ sudo apt-get install codeblocks
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
codeblocks-common libcodeblocks0 libwxbase2.8-0 libwxgtk2.8-0
Suggested packages:
libwxgtk2.8-dev wx-common codeblocks-contrib
The following NEW packages will be installed:
codeblocks codeblocks-common libcodeblocks0 libwxbase2.8-0 libwxgtk2.8-0
0 upgraded, 5 newly installed, 0 to remove and 290 not upgraded.
5 not fully installed or removed.
Need to get 8,574 kB of archives.
After this operation, 30.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libwxbase2.8-0 amd64 2.8.12.1+dfsg-2ubuntu2 [460 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libwxgtk2.8-0 amd64 2.8.12.1+dfsg-2ubuntu2 [2,371 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu/ trusty/universe libcodeblocks0 amd64 13.12-3 [1,807 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu/ trusty/universe codeblocks-common all 13.12-3 [2,570 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu/ trusty/universe codeblocks amd64 13.12-3 [1,366 kB]
Fetched 8,574 kB in 2min 18s (62.0 kB/s)
Selecting previously unselected package libwxbase2.8-0:amd64.
(Reading database ... 168449 files and directories currently installed.)
Preparing to unpack .../libwxbase2.8-0_2.8.12.1+dfsg-2ubuntu2_amd64.deb ...
Unpacking libwxbase2.8-0:amd64 (2.8.12.1+dfsg-2ubuntu2) ...
Selecting previously unselected package libwxgtk2.8-0:amd64.
Preparing to unpack .../libwxgtk2.8-0_2.8.12.1+dfsg-2ubuntu2_amd64.deb ...
Unpacking libwxgtk2.8-0:amd64 (2.8.12.1+dfsg-2ubuntu2) ...
Selecting previously unselected package libcodeblocks0.
Preparing to unpack .../libcodeblocks0_13.12-3_amd64.deb ...
Unpacking libcodeblocks0 (13.12-3) ...
Selecting previously unselected package codeblocks-common.
Preparing to unpack .../codeblocks-common_13.12-3_all.deb ...
Unpacking codeblocks-common (13.12-3) ...
Selecting previously unselected package codeblocks.
Preparing to unpack .../codeblocks_13.12-3_amd64.deb ...
Unpacking codeblocks (13.12-3) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
Setting up python-colorama (0.2.5-0.1ubuntu1) ...
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
ImportError: No module named time
dpkg: error processing package python-colorama (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-distlib (0.1.8-1) ...
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
ImportError: No module named time
dpkg: error processing package python-distlib (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-html5lib (0.999-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
ImportError: No module named time
dpkg: error processing package python-html5lib (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-setuptools (3.3-1ubuntu1) ...
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
ImportError: No module named time
No apport report written because MaxReports is reached already
dpkg: error processing package python-setuptools (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-urllib3 (1.7.1-1build1) ...
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
ImportError: No module named time
dpkg: error processing package python-urllib3 (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Setting up libwxbase2.8-0:amd64 (2.8.12.1+dfsg-2ubuntu2) ...
Setting up libwxgtk2.8-0:amd64 (2.8.12.1+dfsg-2ubuntu2) ...
Setting up libcodeblocks0 (13.12-3) ...
Setting up codeblocks-common (13.12-3) ...
Setting up codeblocks (13.12-3) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Errors were encountered while processing:
python-colorama
python-distlib
python-html5lib
python-setuptools
python-urllib3
E: Sub-process /usr/bin/dpkg returned an error code (1)