yes, that's what I thought. So I thought it would be easier to leave the library's code unchanged and put it in the path. thanks
On Jul 27, 3:12 pm, Yarko Tymciurak <yark...@gmail.com> wrote: > Oh - I see ... this module assumes it's installed; you will need to change > not just __init__.py but also the import line in GChart.py > > On Mon, Jul 27, 2009 at 5:07 PM, Yarko Tymciurak <yark...@gmail.com> wrote: > > 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 <danbr...@gmail.com> wrote: > > >> Thanks Yarko, but that gives me the same error as before. > > >> On Jul 27, 2:14 pm, Yarko Tymciurak <yark...@gmail.com> wrote: > >> > On Mon, Jul 27, 2009 at 3:40 PM, Dan <danbr...@gmail.com> 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 <danbr...@gmail.com> 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 web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---