Problem with urllib2

0 views
Skip to first unread message

stefano

unread,
Mar 24, 2010, 3:44:42 AM3/24/10
to frontpython-discuss.
Hej,

I'm doing a weather plugin for FrontRow. I'm fine with the GUI so
far ...

Now I'm trying to do some internet requests, but all fails already
with the import of some additional
libs

# Standard stuff
import objc
import Foundation
import AppKit
from appscript import *
import time
import PyFR.Utilities

# additional lib
import urllib2

Error Log in Console:

3/24/10 8:42:37 AM FrontRow[42129] ******** Application Startup
********
3/24/10 8:42:47 AM FrontRow[42170] ******** Application Startup
********
3/24/10 8:42:49 AM Front Row[42170] PyeTV: returning populator
singleton
3/24/10 8:42:49 AM Front Row[42170] PyeTV: initing Populator factory
3/24/10 8:42:49 AM Front Row[42170] WeatherFront has encountered a
fatal error, and will now terminate.
3/24/10 8:42:49 AM Front Row[42170] An uncaught exception was raised
during execution of the main script:

ImportError: No module named urllib2

This may mean that an unexpected error has occurred, or that you do
not have all of the dependencies for this bundle.
3/24/10 8:42:49 AM com.apple.RemoteUI[42170] File "/Users/stefan/
Documents/Coding/Apple_Plugins/WeatherFront/dist/
WeatherFront.frappliance/Contents/Resources/__boot__.py", line 49, in
<module>
3/24/10 8:42:49 AM com.apple.RemoteUI[42170]
_run(('\x00\x00\x00\x00\x01@\x00\x02\x00\x00\x06Mac HD
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc59\xc1cH
+\x00\x00\x00HY\x84\x0fWeatherFront.py
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00H]Z
\xc7\xcev\x91\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00I
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x08\x00\x00\xc59\xb3S
\x00\x00\x00\x11\x00\x08\x00\x00\xc7\xceh\x81\x00\x00\x00\x0e\x00
\x00\x0f\x00W\x00e\x00a\x00t\x00h\x00e\x00r\x00F\x00r\x00o\x00n\x00t
\x00.\x00p\x00y\x00\x0f\x00\x0e\x00\x06\x00M\x00a\x00c\x00 \x00H\x00D
\x00\x12\x00HUsers/stefan/Documents/Coding/Apple_Plugins/WeatherFront/
WeatherFront.py\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\r\xff\xff
\x00\x00', '/Users/stefan/Documents/Coding/Apple_Plugins/WeatherFront/
WeatherFront.py'))

3/24/10 8:42:49 AM com.apple.RemoteUI[42170] File "/Users/stefan/
Documents/Coding/Apple_Plugins/WeatherFront/dist/
WeatherFront.frappliance/Contents/Resources/__boot__.py", line 45, in
_run
3/24/10 8:42:49 AM com.apple.RemoteUI[42170] File "/Users/stefan/
Documents/Coding/Apple_Plugins/WeatherFront/WeatherFront.py", line 30,
in <module>
3/24/10 8:42:49 AM com.apple.RemoteUI[42170] from
WeatherFrontMetaData import *
3/24/10 8:42:49 AM com.apple.RemoteUI[42170] File "/Users/stefan/
Documents/Coding/Apple_Plugins/WeatherFront/WeatherFrontMetaData.py",
line 8, in <module>
3/24/10 8:42:49 AM FrontRow[42170] Failed to allow loading of
appliance /System/Library/CoreServices/Front Row.app/Contents/PlugIns/
WeatherFront.frappliance
3/24/10 8:42:49 AM com.apple.RemoteUI[42170] from
WeatherFrontWeatherAPI import *
3/24/10 8:42:49 AM com.apple.RemoteUI[42170] File "/Users/stefan/
Documents/Coding/Apple_Plugins/WeatherFront/
WeatherFrontWeatherAPI.py", line 8, in <module>

stefano

unread,
Mar 24, 2010, 4:09:14 AM3/24/10
to frontpython-discuss.
Just wanted to add ...

As it seems the libs are available in /usr/lib/python2.6.
I also tried to copy all libs into a subfolder (lib) of my project and
import with lib.urllib2 did not solve it.

Any ideas?

Cheers,
Stefan

Jon Christopher

unread,
Mar 24, 2010, 4:28:28 AM3/24/10
to frontpyth...@googlegroups.com
Best guess--- urllib2 is not pure python, but loads a compiled c
library. If that lib is not bundled, you'll get a failure.

> --
> You received this message because you are subscribed to the Google
> Groups "frontpython-discuss." group.
> To post to this group, send email to frontpyth...@googlegroups.com
> .
> To unsubscribe from this group, send email to frontpython-dis...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/frontpython-discuss?hl=en
> .
>

Message has been deleted

stefano

unread,
Mar 24, 2010, 5:52:41 AM3/24/10
to frontpython-discuss.
Okay, got it ...

After cleaning up with

> rm -rf build dist

and compiling without -A

python setup.py py2app

it works.

muchas gracias,

Stefan


On Mar 24, 9:28 am, Jon Christopher <jon.christop...@gmail.com> wrote:
> Best guess--- urllib2 is not pure python, but loads a compiled c
> library. If that lib is not bundled, you'll get a failure.
>

Reply all
Reply to author
Forward
0 new messages