python-z3 package doesn't work, can't import z3

Bug #1609772 reported by W. J. van der Laan
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Fix Released
Medium
Unassigned
z3 (Debian)
Fix Released
Unknown
z3 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

I installed python-z3 but was unable to use it. I cannot import `z3` module in my python interpreter:

$ python2.7
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from z3 import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named z3

The .py and .pyc files are installed to /usr/lib/python2.7/dist-packages/z3. I do note that there is no __init__.py to mark the directory as a package. I don't think that would be right. The usual way to install them seems to be to put z3*.py at top level.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: python-z3 4.4.0-5
ProcVersionSignature: Ubuntu 4.4.0-31.50-generic 4.4.13
Uname: Linux 4.4.0-31-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Aug 4 14:12:09 2016
EcryptfsInUse: Yes
InstallationDate: Installed on 2011-01-29 (2013 days ago)
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
SourcePackage: z3
UpgradeStatus: Upgraded to xenial on 2016-06-11 (53 days ago)

Revision history for this message
W. J. van der Laan (laanwj) wrote :
Revision history for this message
Abhishek (rawcoder) wrote :

Adding __init__.py fixes the problem but then I've to use `from z3.z3 import *` rather than `from z3 import *`. The proper fix would be, as noted by OP, install the z3*.py at top level.

Interestingly, in lp v4.4.0-2 of the package, the changelog (https://launchpad.net/ubuntu/+source/z3/4.4.0-2) mentions adding __init__.py but it isn't included in the amd64 .deb.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in z3 (Ubuntu):
status: New → Confirmed
Changed in z3 (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for taking your time to report this issue and help making Ubuntu better.

I found a corresponding bug report in Debian, so I have attached a bug watch. This is marked as fixed, so someone should verify that this issue is gone with the newer version available in Ubuntu Yakkety. If it is resolved, it might be possible to take a minimal patch and apply that for 16.04 in order to fix it there as well.

Changed in z3 (Debian):
status: Unknown → Fix Released
Revision history for this message
Paul White (paulw2u) wrote :

Ubuntu changelog confirms issue fixed in version 4.4.1-0.1

Changed in z3 (Ubuntu):
status: Confirmed → Fix Released
Changed in hundredpapercuts:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.