you updated the __init__.py of GChartWrapper also? You have two choices - either modify this to work as a web2py module, and be sure it deals with it's path, or - install it in the python path as a normal python module.
Even if you are on a hosting service, you should be able to do local installs of modules. On Mon, Jul 27, 2009 at 4:56 PM, Dan <[email protected]> wrote: > > Thanks Yarko, but that gives me the same error as before. > > On Jul 27, 2:14 pm, Yarko Tymciurak <[email protected]> wrote: > > On Mon, Jul 27, 2009 at 3:40 PM, Dan <[email protected]> wrote: > > > > > Is the appropriate solution to put the library code in web2py/ and use > > > this import statement? > > > from GChartWrapper import * > > > > > that seems to work, but I'd prefer to have the library in web2py/ > > > applications/myapp/modules/ > > > > then you will need to use something like: > > > > from applications.myapp.modules.GChartWrapper import * > > > > > > > > > On Jul 27, 12:24 pm, Dan <[email protected]> wrote: > > > > Hello- > > > > I'd like to use some google charts (http://code.google.com/apis/ > > > > chart/) in my web2py app. Instead of creating the URLs manually, I > > > > would prefer to use a wrapper library, and this one looks like a good > > > > candidate:http://code.google.com/p/google-chartwrapper/ > > > > > > So I tried to put the code from that library in the /web2py/ > > > > applications/myapp/modules/ directory and then import it in my > > > > controller, like this ... > > > > > > exec('from applications.%s.modules import > > > > GChartWrapper'%request.application) > > > > > > ... but I get this error: > > > > > > File ".../modules/GChartWrapper/__init__.py", line 1, in <module> > > > > from GChartWrapper.GChart import * > > > > ImportError: No module named GChartWrapper.GChart > > > > > > Is there a proper way to import this kind of library? Or do I need to > > > > make changes to the library's __init__.py file and other files? > > > > > > thanks, > > > > Dan > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

