0

So I tried running an example Nodebox tutorial.

Here's the code:

g = grid.create(2, 2, 250, 250)
g.top.left.split(2, 2)
g.top.left.bottom.right.split(2, 2)
 
# fetch images from Morguefile.com
web = ximport("web")
img = web.morguefile.search("ocean")[:5]
img = [x.download() for x in img]
g.content = images
g.content.repeat = True
 
g.styles.margin = 1
g.styles.fit = True
g.styles.align = "center", "bottom"

Which basically downloads from a site called morguefile. I played with it and tried flickr, which also works. I tried google and youtube, but neither worked. When I changed back to flickr, I started getting errors like:

AttributeError: 'module' object has no attribute 'youtube'

But that is not part of my code anymore! I suspect that my pythonpath could be wrong. I once had a similar problem and restarted my Mac and than it worked again.

If there is no solution, how can I start from scratch?

Community
  • 1
  • 1
digit
  • 1,513
  • 5
  • 29
  • 49
  • could you instead post the actual code that causes the issue? – Uku Loskit Feb 11 '11 at 19:56
  • well i did. That is the code. Only that I modified web.morguefile.search("ocean") into web.youtube.search and than changed it back to the same and it gave me that error. Like if the error would be stuck in the system. I dont have an explanation for that. – digit Feb 11 '11 at 20:05

1 Answers1

1

From what I can gather about the library, web defined Yahoo, morgueFile etc. They did not include youtube + google.

Web is a module; the module has methods and attributed hard-coded in. You can't just cut and copy out websites into the attribute and expect it to work. I'm pretty sure the reason they're hard-coded in is because you can use these websites to search images (probably through their respective APIs) and then download them.

I have no idea what you're trying to do, but I recommend reading the documentation and possibly reading up on python some more.

At any rate, unless you post your actual code, I can't really help you.

joslinm
  • 7,845
  • 6
  • 49
  • 72
  • Thanks. What you described I knew already. I think I solved it and the problem was the proxy. And to make the problem clear again: I got an error message from nodebox that refereed to code that wasnt part of my code anymore. I deleted youtube and google and went back to the code you see above and then ran it and I got as an error message youtube and google. So it was NOT in my code, but nodebox gave me an error as if it would still be part of the code. That was my problem. – digit Feb 13 '11 at 09:08