python plugin doesn't work for namespace packages

Bug #1675479 reported by Corey Bryant
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

snapcraft version: commit dbdaf36a43c7e5682d00e34552ce283f4ec1fc9d (this is the fix for

When testing the above bug fix, I started hitting the following issue. Note: the above commit did fix the issue reported in that bug.

The snap installs successfully now. However, python dependencies aren't fully getting installed. I don't hit these issues on 2.22.

For example, after installing the snap, running a command from the snap I hit this:
And /snap/keystone/current/lib/python2.7/site-packages/repoze/lru/ does in fact exist.
'touch /snap/keystone/current/lib/python2.7/site-packages/repoze/lru/' got me past that issue.

Then starting a daemon 'sudo systemctl restart snap.keystone.api' I hit:

Once again, 'touch /snap/keystone/x1/lib/python2.7/site-packages/paste/' seemed to fix that issue.

It seems that the cause of this problem may be due to:

Leo Arias (elopio)
tags: added: openstack plugin
Changed in snapcraft:
status: New → Confirmed
importance: Undecided → High
Leo Arias (elopio)
Changed in snapcraft:
milestone: none → 2.29
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

I don't see that error, but I had to make modifications to your snapcraft.yaml ->

the environment entries are currently broken in snapd. You also want to use a fixed python (the one in the snap to get the correct sitecustomize which gets PYTHONPATH just right).

What is missing here is the fact that you are not compiling your own python and are creating a classic snap. This will cause issues.

I'll mark this bug as invalid for now, but feel free to reopen or open a new one, but .pth files seem to work.

snapper@snap-testing:~$ $SNAP/usr/bin/python2
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from paste import deploy

^-- no exception ;-)

Changed in snapcraft:
status: Confirmed → Invalid
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Hey Sergio, so something must be different in our environments but I'm not sure what.

I'm still hitting this on xenial and zesty, using both the snapcraft snap and the deb:
  - snap: snapcraft 2.28 rev 19
  - deb: snapcraft 2.28+17.04

I've attached a new snapcraft.yaml that recreates it. Note this time around I'm compiling python2.7.

Changed in snapcraft:
status: Invalid → New
Revision history for this message
Corey Bryant (corey.bryant) wrote :

As a work around I've added the following to the keystone section:

  touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/paste/
  touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/repoze/

Changed in snapcraft:
milestone: 2.29 → 2.30
Changed in snapcraft:
milestone: 2.30 → none
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.