:~$ sudo apt-get install python3-pexpect
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pexpect is already the newest version.
The following packages were automatically installed and are no longer required:
freeglut3-dev libglew-dev libgoogle-perftools4 libtcmalloc-minimal4
libunwind8 libv8-3.14.5 mongodb mongodb-clients mongodb-dev mongodb-server
python-bson python-bson-ext python-gridfs python-pyassimp python-pymongo
python-pymongo-ext ros-indigo-household-objects-database-msgs
ros-indigo-ompl ros-indigo-pr2-arm-kinematics ros-indigo-pr2-moveit-plugins
ros-indigo-warehouse-ros texmaker-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
python-libxml2 python-samba
The following packages will be upgraded:
python-libxml2 python-samba
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
Need to get 0 B/1.207 kB of archives.
After this operation, 1.024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 844116 files and directories currently installed.)
Preparing to unpack .../python-libxml2_2.9.1+dfsg1-3ubuntu4.10_amd64.deb ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/python-libxml2_2.9.1+dfsg1-3ubuntu4.10_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Preparing to unpack .../python-samba_2%3a4.3.11+dfsg-0ubuntu0.14.04.12_amd64.deb ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/python-samba_2%3a4.3.11+dfsg-0ubuntu0.14.04.12_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/python-libxml2_2.9.1+dfsg1-3ubuntu4.10_amd64.deb
/var/cache/apt/archives/python-samba_2%3a4.3.11+dfsg-ubuntu0.14.04.12_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Это связано с ошибкой:
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
Скорее всего, это потому, что он ожидает python2.x вместо python3.
Вы должны связать /usr/bin/python
с соответствующей версией. Если я не ошибаюсь /usr/bin/python --version
выдаст 3.x Так что, возможно, вам нужно создать символическую ссылку на python2.x:
ls -la /usr/bin/python # you will see if there's a symlink towards some other file
rm /usr/bin/python # only if it is a symlink!
ln -s /usr/bin/python2.x /usr/bin/python
где 2.x
- ваша версия python.
Или, проще, но вам нужно установить оба 2.x и 3.x:
sudo update-alternatives --config python