[yt-users] yt unable to find sip module

Gary Foreman gforema2 at illinois.edu
Tue Sep 3 10:42:24 PDT 2013


Matt and Nathan,

Thanks very much for helping me so quickly!

Matt, your suggestion to use backend : Agg did the trick. At this point
both iyt and the script I was using when I first encountered the error are
working fine. So it sounds like if I'd like to use pyplot interactively,
I'll have to do so outside of yt and change my matplotlib backend back to
qt4agg, but that won't be a big deal now that I know what I'm doing :)

Gary


On Tue, Sep 3, 2013 at 12:20 PM, Matthew Turk <matthewturk at gmail.com> wrote:

> Hi Gary,
>
> Sorry about the troubles!  Nathan's definitely provided some good
> suggestions; let's see if we can figure out what's up.  I have some
> questions and ideas.
>
> On Mon, Sep 2, 2013 at 5:32 PM, Gary Foreman <gforema2 at illinois.edu>
> wrote:
> > Hello,
> >
> > Suddenly my yt distribution seems to be broken because it cannot find the
> > module sip. Sip appears to be a python/C interface that is called by
> > matplotlib.pyplot. I have tried a few things to resolve the issue, none
> of
> > which have worked. I've tried: yt update --all, pip install sip, and
> apt-get
> > install yt using the repository mentioned on the Get YT page. pip install
> > and apt-get install fail for separate reasons, which I can explain in a
> > future email if necessary.
> >
> > Since first encountering this problem, I have updated my OS because I
> > realized I was using an outdated version of Ubuntu. I am now running
> Ubuntu
> > 12.4 LTS. The OS update did not resolve the issue.
>
> I think the best bet, right now, is *just* the install_script.sh
> method for Ubuntu.
>
> >
> > It seems worth mentioning that the default system python distribution is
> > working fine and I am able to import pyplot as well as sip without a
> > problem. During a quick search of the yt distribution, I did not find the
> > same sip related files that I have in my system's python distribution.
> >
> > Also, as of Friday, things are working fine with the yt distribution I
> have
> > on my Mac laptop.
>
> That's good to hear!  :)
>
> >
> > Thanks very much in advance for your help. Please let me know if you
> would
> > like me to post some of the error messages I have received from the few
> > solutions that I've tried.
>
> Here's what I suspect is going on.  A recent change to Matplotlib
> modifies the type of backend that is selected by default for pyplot.
> We've seen issues crop up on OSX recently from this change as well,
> where the python installed is not built in such a way as to enable the
> given frontend.  On Linux, this would manifest as not being able to
> access Qt -- the backend in particular is PyQt4, and it depends on
> SIP, which as you and Nathan noted is a mechanism for interfacing C++
> and Python code.
>
> Unfortunately, the problems run a bit deeper, in that yt's base
> install builds a Python that is distinct from the system's python, and
> so binary modules may not work across those two.  This further causes
> problems because the Qt python wrappings will have to be built against
> *yt's* python, and then that just builds an enormous stack of
> dependencies that's tough to resolve.  Typically what we do is simply
> not enable the PyQt4 backend.  One issue with the backend selection
> process is that it is often fatal; rather than defaulting to a backend
> that works, the matplotlib/pyplot interface just fails out.
>
> What I would suggest as a broad strategy is: do not attempt to get the
> yt python and system python to work together, and don't try to get the
> PyQt4 bindings that are apt-get-able to work with the yt-installed
> Python -- it's just going to dig deeper and deeper.  Instead, turn off
> the PyQt4 backend and use Agg, similar to how Nathan suggested, but
> switching "TkAgg" for "Agg".
>
> But, this also means no interactive pyplot sessions.  This is an
> enormous problem, and unfortunately getting everything to play nicely
> is somewhat difficult for us as a (relatively) small project to
> manage.  What we are attempting to do is instead step aside the
> packaging issue and *stop* attempting to create a full yt stack.  Our
> first discussion of this was on yt-dev the other day:
>
>
> http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/2013-August/003386.html
>
> So, short term: switch the backend to Agg, which should fix things
> from that perspective but won't give interactive plotting widgets.
> Longer term, we are going to clean up the yt house to play much, much
> nicer with both distributions (like Ubuntu) and with python
> distributions (like Conda/Anaconda) to keep this from happening in the
> future and to make way more functionality available.
>
> Let me know if that fix works!
>
> -Matt
>
> >
> > Gary
> >
> > _______________________________________________
> > yt-users mailing list
> > yt-users at lists.spacepope.org
> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130903/0302c956/attachment.htm>


More information about the yt-users mailing list