<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-family: Verdana,Geneva,sans-serif'>
<p>On 2014-01-07 07:16, Doug Hellmann wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px">
<div dir="ltr">
<div class="gmail_default" style="font-size: small;"> </div>
<div class="gmail_extra"><br /><br />
<div class="gmail_quote">On Tue, Jan 7, 2014 at 6:24 AM, Michael Kerrin <span><<a href="mailto:michael.kerrin@hp.com">michael.kerrin@hp.com</a>></span> wrote:<br />
<blockquote class="gmail_quote" style="margin: 0  0  0  .8ex; border-left: 1px  #ccc  solid; padding-left: 1ex;">
<div style="font-size: 9pt; font-weight: 400; font-style: normal;">
<p style="text-indent: 0px; margin: 0px;">I have been seeing this problem also.</p>
<p style="text-indent: 0px; margin: 0px;">My problem is actually with oslo.sphinx. I ran sudo pip install -r test-requirements.txt in cinder so that I could run the tests there, which installed oslo.sphinx.</p>
<p style="text-indent: 0px; margin: 0px;">Strange thing is that the oslo.sphinx installed a directory called oslo in /usr/local/lib/python2.7/dist-packages with no __init__.py file. With this package installed like so I get the same error you get with oslo.config.</p>
</div>
</blockquote>
<div> </div>
<div>
<div class="gmail_default" style="font-size: small;">The oslo libraries use python namespace packages, which manifest themselves as a directory in site-packages (or dist-packages) with sub-packages but no __init__.py(c). That way oslo.sphinx and oslo.config can be packaged separately, but still installed under the "oslo" directory and imported as oslo.sphinx and oslo.config.</div>
<div class="gmail_default" style="font-size: small;"> </div>
<div class="gmail_default" style="font-size: small;">My guess is that installing oslo.sphinx globally (with sudo), set up 2 copies of the namespace package (one in the global dist-packages and presumably one in the virtualenv being used for the tests).</div>
</div>
</div>
</div>
</div>
</blockquote>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>
<div class="gmail_default">Actually I think it may be the opposite problem, at least where I'm currently running into this.  oslo.sphinx is only installed in the venv and it creates a namespace package there.  Then if you try to load oslo.config in the venv it looks in the namespace package, doesn't find it, and bails with a missing module error.</div>
<div class="gmail_default"> </div>
<div class="gmail_default">I'm personally running into this in tempest - I can't even run pep8 out of the box because the sample config check fails due to missing oslo.config.  Here's what I'm seeing:</div>
<div class="gmail_default"> </div>
<div class="gmail_default">In the tox venv:</div>
<div class="gmail_default">(pep8)[fedora@devstack site-packages]$ ls oslo*<br />oslo.sphinx-1.1-py2.7-nspkg.pth<br /><br />oslo:<br />sphinx<br /><br />oslo.sphinx-1.1-py2.7.egg-info:<br />dependency_links.txt  namespace_packages.txt  PKG-INFO     top_level.txt<br />installed-files.txt   not-zip-safe            SOURCES.txt</div>
<div class="gmail_default"> </div>
<div class="gmail_default"> </div>
<div class="gmail_default">And in the system site-packages:</div>
<div class="gmail_default">[fedora@devstack site-packages]$ ls oslo*<br />oslo.config.egg-link  oslo.messaging.egg-link</div>
<div class="gmail_default"> </div>
<div class="gmail_default"> </div>
<div class="gmail_default">Since I don't actually care about oslo.sphinx in this case, I also found that deleting it from the venv fixes the problem, but obviously that's just a hacky workaround.  My initial thought is to install oslo.sphinx in devstack the same way as oslo.config and oslo.messaging, but I assume there's a reason we didn't do it that way in the first place so I'm not sure if that will work.</div>
<div class="gmail_default"> </div>
<div class="gmail_default">So I don't know what the proper fix is, but I thought I'd share what I've found so far.  Also, I'm not sure if this even relates to the ceilometer issue since I wouldn't expect that to be running in a venv, but it may have a similar issue.</div>
<div class="gmail_default"> </div>
<div class="gmail_default">-Ben</div>
</div>
</div>
</div>
</div>
<div> </div>
</body></html>