[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pythonmac-sig
Subject:    Re: [Pythonmac-SIG] [py2app] No module named os
From:       Chris Weisiger <cweisiger () msg ! ucsf ! edu>
Date:       2010-09-10 22:06:21
Message-ID: AANLkTikBB+5f-aV723M=hHQS9QQ0+ZOjO+wOntRtAg7E () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Whelp, this problem is back, with a different program this time. All the
fixes I have written down from last time don't work. Fortunately this time I
don't have any dependencies on weird homegrown libraries that require hours
of fiddling -- just on wx, paramiko, and Crypto.

To recap: py2app generates an application successfully. Per my post earlier
today (
http://old.nabble.com/py2app-program-unable-to-find-files-in-lib-dynload-td29679814.html),
 I then hack __boot__.py to modify sys.path so it can find SHA256.so.
The
program runs just fine on my development computer. I take it over to a
client computer and try to run it. It tries 'import os' and fails.

Last time I speculated that this was due to stale pyc files hanging around.
I've removed all pyc files from the app and it still fails, so that's not
what's going wrong here. Without access to os, I can't check environment
variables, let alone change them. Frankly I don't have a clue how to debug
this short of random flailings -- and I spent three days or so on that last
time before stumbling across something that worked. Comparing that working
program to this nonworking program hasn't turned up any obvious
discrepancies, though.

Anyway, my source code is online here:

http://derakon.dyndns.org/~chriswei/temp2/processor.tgz

If you have any insight into this problem, I'd love to hear it.

-Chris

On Mon, Aug 23, 2010 at 4:55 PM, Dan Ross <dan@rosspixelworks.com> wrote:

> Happy to try.
> 
> Glad you got it sorted out.
> 
> 
> 
> On Mon, 23 Aug 2010 15:39:17 -0700, Chris Weisiger <cweisiger@msg.ucsf.edu>
> wrote:
> 
> That's odd. I get the "couldn't load module(s): P" but Y loads fine. These
> are legacy modules from a previous developer, and I generally try to avoid
> dealing with them. "Y" refers to either "usefulX.py" or "usefulX2.py", I'm
> not certain which. Both are in the Priithon directory. (Note that they
> aren't imported as "X" because that's the letter used for one of the modules
> the original developer named after himself...fortunately not in this
> particular program)
> 
> However, I was able to get a standalone version working. I started poking
> at the __boot__.py and site.py files in the generated app, and somehow that
> made the failures to import fundamental libraries like os and traceback go
> away. My only guess is that maybe py2app was including the .pyc files that
> had been generated on my local computer? Anyway, after that I got failures
> to import numpy.Tester, which are I think due to a version mismatch on my
> end. Easily fixed, though, as that module's not actually needed; I just
> commented out the imports.
> 
> Thanks for being willing to take a look! I think maybe I just needed a
> weekend of not thinking about it so I could come back to the problem fresh.
> > )
> 
> -Chris
> 
> On Mon, Aug 23, 2010 at 3:26 PM, Dan Ross <dan@rosspixelworks.com> wrote:
> 
> > Hmmm.....
> > 
> > I'm getting this when I try to run it from Terminal:
> > 
> > dan-rosss-macbook-pro:editor dan$ python editor.py
> > * couldn't load module(s):    Y  P
> > 
> > Traceback (most recent call last):
> > File "editor.py", line 7, in
> > import mainapp
> > File "/Users/dan/Desktop/editor/mainapp.py", line 2, in
> > import demoframe
> > File "/Users/dan/Desktop/editor/demoframe.py", line 6, in
> > import imeditpanel
> > File "/Users/dan/Desktop/editor/imeditpanel.py", line 12, in
> > import realign
> > File "/Users/dan/Desktop/editor/realign.py", line 8, in
> > from Priithon.all import F, Y
> > ImportError: cannot import name Y
> > 
> > 
> > Can you tell me what's supposed to be happening?
> > 
> > On 8/23/10 10:18 AM, Chris Weisiger wrote:
> > 
> > I've put the program online here:
> > 
> > http://derakon.dyndns.org/~chriswei/temp2/editor.tgz<http://derakon.dyndns.org/%7Echriswei/temp2/editor.tgz>
> >  
> > When run, it should show a large blank window with four icons in the
> > upper-left corner.
> > 
> > Thanks for being willing to take a look.
> > 
> > -Chris
> > 
> > On Sat, Aug 21, 2010 at 6:12 AM, Dan Ross <dan@rosspixelworks.com> wrote:
> > 
> > > Hey Chris-
> > > 
> > > Is the source available anywhere? I've made a few wx apps and that sounds
> > > familiar.
> > > 
> > > Dan
> > > 
> > > 
> > 
> 
> 


[Attachment #5 (text/html)]

Whelp, this problem is back, with a different program this time. All the fixes I have \
written down from last time don&#39;t work. Fortunately this time I don&#39;t have \
any dependencies on weird homegrown libraries that require hours of fiddling -- just \
on wx, paramiko, and Crypto. <br> <br>To recap: py2app generates an application \
successfully. Per my post earlier today ( <a \
href="http://old.nabble.com/py2app-program-unable-to-find-files-in-lib-dynload-td29679 \
814.html">http://old.nabble.com/py2app-program-unable-to-find-files-in-lib-dynload-td29679814.html</a> \
), I then hack __boot__.py to modify sys.path so it can find SHA256.so. The program \
runs just fine on my development computer. I take it over to a client computer and \
try to run it. It tries &#39;import os&#39; and fails. <br> <br>Last time I \
speculated that this was due to stale pyc files hanging around. I&#39;ve removed all \
pyc files from the app and it still fails, so that&#39;s not what&#39;s going wrong \
here. Without access to os, I can&#39;t check environment variables, let alone change \
them. Frankly I don&#39;t have a clue how to debug this short of random flailings -- \
and I spent three days or so on that last time before stumbling across something that \
worked. Comparing that working program to this nonworking program hasn&#39;t turned \
up any obvious discrepancies, though.<br> <br>Anyway, my source code is online \
here:<br><br><a href="http://derakon.dyndns.org/~chriswei/temp2/processor.tgz">http://derakon.dyndns.org/~chriswei/temp2/processor.tgz</a><br><br>If \
you have any insight into this problem, I&#39;d love to hear it.<br> \
<br>-Chris<br><br><div class="gmail_quote">On Mon, Aug 23, 2010 at 4:55 PM, Dan Ross \
<span dir="ltr">&lt;<a \
href="mailto:dan@rosspixelworks.com">dan@rosspixelworks.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <p>Happy to try.</p>
<p>Glad you got it sorted out.</p><div class="im">
<p> </p>
<p>On Mon, 23 Aug 2010 15:39:17 -0700, Chris Weisiger &lt;<a \
href="mailto:cweisiger@msg.ucsf.edu" target="_blank">cweisiger@msg.ucsf.edu</a>&gt; \
wrote:</p> </div><blockquote style="border-left: 2px solid rgb(16, 16, 255); \
padding-left: 5px; margin-left: 5px; width: 100%;"><div class="im"> <p>That&#39;s \
odd. I get the &quot;couldn&#39;t load module(s): P&quot; but Y loads fine. These are \
legacy modules from a previous developer, and I generally try to avoid dealing with \
them. &quot;Y&quot; refers to either &quot;usefulX.py&quot; or \
&quot;usefulX2.py&quot;, I&#39;m not certain which. Both are in the Priithon \
directory. (Note that they aren&#39;t imported as &quot;X&quot; because that&#39;s \
the letter used for one of the modules the original developer named after \
himself...fortunately not in this particular program)<br> <br>However, I was able to \
get a standalone version working. I started poking at the __boot__.py and site.py \
files in the generated app, and somehow that made the failures to import fundamental \
libraries like os and traceback go away. My only guess is that maybe py2app was \
including the .pyc files that had been generated on my local computer? Anyway, after \
that I got failures to import numpy.Tester, which are I think due to a version \
mismatch on my end. Easily fixed, though, as that module&#39;s not actually needed; I \
just commented out the imports. <br> <br>Thanks for being willing to take a look! I \
think maybe I just needed a weekend of not thinking about it so I could come back to \
the problem fresh. :)<br><br>-Chris<br><br></p> </div><div class="gmail_quote"><div \
class="im">On Mon, Aug 23, 2010 at 3:26 PM, Dan Ross <span>&lt;<a \
href="mailto:dan@rosspixelworks.com" \
target="_blank">dan@rosspixelworks.com</a>&gt;</span> wrote:<br> </div><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> <div><span style="font-family: \
Helvetica,Arial,sans-serif;"><div class="im">Hmmm.....<br><br> I&#39;m getting this \
when I try to run it from Terminal:<br><br> dan-rosss-macbook-pro:editor dan$ python \
editor.py<br>  * couldn&#39;t load module(s):    Y  P <div><br> Traceback (most \
recent call last):</div>  File &quot;editor.py&quot;, line 7, in <br></div><div \
class="im">     import mainapp<br>   File \
&quot;/Users/dan/Desktop/editor/mainapp.py&quot;, line 2, in       <br></div><div \
class="im">     import demoframe<br>   File \
&quot;/Users/dan/Desktop/editor/demoframe.py&quot;, line 6, in       <br> </div><div \
class="im">     import imeditpanel<br>   File \
&quot;/Users/dan/Desktop/editor/imeditpanel.py&quot;, line 12, in       \
<br></div><div class="im">     import realign<br>   File \
&quot;/Users/dan/Desktop/editor/realign.py&quot;, line 8, in       <br> </div><div \
class="im">     from Priithon.all import F, Y<br> ImportError: cannot import name \
Y<br><br><br> Can you tell me what&#39;s supposed to be \
happening?<br></div></span><div class="im"> <div>
<div><br> On 8/23/10 10:18 AM, Chris Weisiger wrote:
<blockquote>I&#39;ve put the program online here:<br><br><a \
href="http://derakon.dyndns.org/%7Echriswei/temp2/editor.tgz" \
target="_blank">http://derakon.dyndns.org/~chriswei/temp2/editor.tgz</a><br><br> When \
run, it should show a large blank window with four icons in       the upper-left \
corner. <br> <br> Thanks for being willing to take a look.<br><br> -Chris<br><br>
<div class="gmail_quote">On Sat, Aug 21, 2010 at 6:12 AM, Dan Ross         \
<span>&lt;<a href="mailto:dan@rosspixelworks.com" \
target="_blank">dan@rosspixelworks.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> <div><span style="font-family: \
Helvetica,Arial,sans-serif;">Hey Chris-<br><br> Is the source available anywhere? \
I&#39;ve made a few wx apps               and that sounds familiar.<br><br> \
Dan<br><br></span></div> </blockquote>
</div>
<br></blockquote>
</div>
</div>
</div></div>
</blockquote>
</div>
<br></blockquote>
<p> </p></blockquote></div><br>



_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic