import utmp fails with ImportError: No module named utmpaccess
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-utmp (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
In a fresh installation of Ubuntu 16.04, I install python, and python-utmp. I run python and try to import utmp. The import fails as follows:
$ python
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import utmp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
import utmpaccess
ImportError: No module named utmpaccess
>>>
Description: Ubuntu 16.04 LTS
Release: 16.04
$ apt-cache policy python
python:
Installed: 2.7.11-1
Candidate: 2.7.11-1
Version table:
*** 2.7.11-1 500
500 http://
100 /var/lib/
$ apt-cache policy python-utmp
python-utmp:
Installed: 0.8.2
Candidate: 0.8.2
Version table:
*** 0.8.2 500
500 http://
100 /var/lib/
I believe this bug is caused by the transition from dh_pysupport to dh_python2 and the difference in how shared libraries are handled.
The old package (0.8+nmu1ubuntu3) installed the .so file here: pyshared/ python2. 7/utmpaccessmod ule.so
/usr/lib/
The new package (0.8.2) installs the .so file here: python2. 7/dist- packages/ utmpaccessmodul e.arm-linux- gnueabihf. so
/usr/lib/
Python can't find the module in the new location. It either needs to be: python2. 7/dist- packages/ utmpaccessmodul e.so python2. 7/dist- packages/ utmpaccess. arm-linux- gnueabihf. so
/usr/lib/
Or here:
/usr/lib/
I believe the second is correct.