brettski74
May 6th, 2011, 04:07 AM
I upgraded from Maverick to Natty a few days ago. Prior to the upgrade, mercurial was working fine. Tonight I tried to do my first commit since the upgrade and it fails with:
blg@odin:~/dev/mortgage$ hg status
abort: couldn't find mercurial libraries in [/usr/bin /usr/lib/python27.zip /usr/lib/python2.7 /usr/lib/python2.7/plat-linux2 /usr/lib/python2.7/lib-tk /usr/lib/python2.7/lib-old /usr/lib/python2.7/lib-dynload /usr/lib/python2.7/site-packages]
(check your install and PYTHONPATH)
blg@odin:~/dev/mortgage$
My first thought was that maybe the upgrade uninstalled mercurial for some reason, however, KPackageKit shows it installed. I did a reinstall using apt-get instead, but this generated the following errors.
blg@odin:~/dev/mortgage$ apt-get install --reinstall mercurial
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
blg@odin:~/dev/mortgage$ sudo apt-get install --reinstall mercurial
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libva-x11-1 g++-4.4 libstdc++6-4.4-dev libcddb2 libdvbpsi6 libx264-98 libupnp3 libxcb-randr0 libiso9660-7 libgnomevfs2-extra libxdot4
apport-hooks-medibuntu firefox-branding libtar esound-clients libvcdinfo0 libebml2 libmatroska2 libpoppler-glib5 libsdl-image1.2
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 78 not upgraded.
3 not fully installed or removed.
Need to get 0 B/1,539 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 239828 files and directories currently installed.)
Preparing to replace mercurial-common 1.7.5-1ubuntu1 (using .../mercurial-common_1.7.5-1ubuntu1_all.deb) ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: error processing /var/cache/apt/archives/mercurial-common_1.7.5-1ubuntu1_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Preparing to replace mercurial 1.7.5-1ubuntu1 (using .../mercurial_1.7.5-1ubuntu1_i386.deb) ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: error processing /var/cache/apt/archives/mercurial_1.7.5-1ubuntu1_i386.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mercurial-common_1.7.5-1ubuntu1_all.deb
/var/cache/apt/archives/mercurial_1.7.5-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
blg@odin:~/dev/mortgage$
I've also tried a reinstall of python via apt-get as well. Both python-2.6 and Python-2.7 appear to be installed, but based on the problems above, it looks like the python-2.7 installation may have some library issues. Unfortunately, python is not a language I'm familiar with, so I don't know where to look next. The only similar error messages I can find in the Python bug reports relate to python 3, so I'm not sure if they're relevant here or not.
Any advice would be greatly appreciated.
blg@odin:~/dev/mortgage$ hg status
abort: couldn't find mercurial libraries in [/usr/bin /usr/lib/python27.zip /usr/lib/python2.7 /usr/lib/python2.7/plat-linux2 /usr/lib/python2.7/lib-tk /usr/lib/python2.7/lib-old /usr/lib/python2.7/lib-dynload /usr/lib/python2.7/site-packages]
(check your install and PYTHONPATH)
blg@odin:~/dev/mortgage$
My first thought was that maybe the upgrade uninstalled mercurial for some reason, however, KPackageKit shows it installed. I did a reinstall using apt-get instead, but this generated the following errors.
blg@odin:~/dev/mortgage$ apt-get install --reinstall mercurial
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
blg@odin:~/dev/mortgage$ sudo apt-get install --reinstall mercurial
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libva-x11-1 g++-4.4 libstdc++6-4.4-dev libcddb2 libdvbpsi6 libx264-98 libupnp3 libxcb-randr0 libiso9660-7 libgnomevfs2-extra libxdot4
apport-hooks-medibuntu firefox-branding libtar esound-clients libvcdinfo0 libebml2 libmatroska2 libpoppler-glib5 libsdl-image1.2
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 78 not upgraded.
3 not fully installed or removed.
Need to get 0 B/1,539 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 239828 files and directories currently installed.)
Preparing to replace mercurial-common 1.7.5-1ubuntu1 (using .../mercurial-common_1.7.5-1ubuntu1_all.deb) ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: error processing /var/cache/apt/archives/mercurial-common_1.7.5-1ubuntu1_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Preparing to replace mercurial 1.7.5-1ubuntu1 (using .../mercurial_1.7.5-1ubuntu1_i386.deb) ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: error processing /var/cache/apt/archives/mercurial_1.7.5-1ubuntu1_i386.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 11, in <module>
import sys,os,shutil
File "/usr/lib/python2.7/shutil.py", line 12, in <module>
import collections
File "/usr/lib/python2.7/collections.py", line 8, in <module>
from _collections import deque, defaultdict
ImportError: No module named _collections
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mercurial-common_1.7.5-1ubuntu1_all.deb
/var/cache/apt/archives/mercurial_1.7.5-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
blg@odin:~/dev/mortgage$
I've also tried a reinstall of python via apt-get as well. Both python-2.6 and Python-2.7 appear to be installed, but based on the problems above, it looks like the python-2.7 installation may have some library issues. Unfortunately, python is not a language I'm familiar with, so I don't know where to look next. The only similar error messages I can find in the Python bug reports relate to python 3, so I'm not sure if they're relevant here or not.
Any advice would be greatly appreciated.