Re: [web2py] Best practice for including python libraries with my app
I use site-packages directory to put external libraries. Because, I tried gdata (google data ) library to put in app modules folder. But it breaks on import, because, gdata module has no knowledge of local_import() and since they try to do imports with usual way, it'll break. So, for complex libraries I suggest to put it in site-packages directory. Make not of server version of python is supported by library you put in.
[web2py] Best practice for including python libraries with my app
I am using tabular http://www.parsemydata.com/tabular (which requires numpy), as well as psycopg2 and a number of other libraries. The default location for such things is one of the local site-packages directories, which of course, doesn't migrate to another machine automagically. What's the best practice for this sort of thing? -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m)
Re: [web2py] Best practice for including python libraries with my app
try to import, and if fails, generate message to user to install it on the system Alexandre Andrade Hipercenter.com Classificados Gratuitos e Inteligentes 2011/1/13 Lorin Rivers lriv...@mosasaur.com I am using tabular http://www.parsemydata.com/tabular (which requires numpy), as well as psycopg2 and a number of other libraries. The default location for such things is one of the local site-packages directories, which of course, doesn't migrate to another machine automagically. What's the best practice for this sort of thing? -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m) -- Atenciosamente
Re: [web2py] Best practice for including python libraries with my app
That's exactly the kind of user experience I want to avoid. On Jan 13, 2011, at 13:34 , Alexandre Andrade wrote: try to import, and if fails, generate message to user to install it on the system Alexandre Andrade Hipercenter.com Classificados Gratuitos e Inteligentes 2011/1/13 Lorin Rivers lriv...@mosasaur.com I am using tabular http://www.parsemydata.com/tabular (which requires numpy), as well as psycopg2 and a number of other libraries. The default location for such things is one of the local site-packages directories, which of course, doesn't migrate to another machine automagically. What's the best practice for this sort of thing? -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m) -- Atenciosamente -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m)
Re: [web2py] Best practice for including python libraries with my app
Put your libraries under app/modules an use local_import() Bruno Rocha http://about.me/rochacbruno/bio 2011/1/13 Lorin Rivers lriv...@mosasaur.com That's exactly the kind of user experience I want to avoid. On Jan 13, 2011, at 13:34 , Alexandre Andrade wrote: try to import, and if fails, generate message to user to install it on the system Alexandre Andrade Hipercenter.com Classificados Gratuitos e Inteligentes 2011/1/13 Lorin Rivers lriv...@mosasaur.com I am using tabular http://www.parsemydata.com/tabular (which requires numpy), as well as psycopg2 and a number of other libraries. The default location for such things is one of the local site-packages directories, which of course, doesn't migrate to another machine automagically. What's the best practice for this sort of thing? -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m) -- Atenciosamente -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m)
Re: [web2py] Best practice for including python libraries with my app
And for details, check out: http://web2py.com/book/default/chapter/04#Third-Party-Modules On Thursday, January 13, 2011 2:52:50 PM UTC-5, rochacbruno wrote: Put your libraries under app/modules an use local_import() Bruno Rocha http://about.me/rochacbruno/bio 2011/1/13 Lorin Rivers lri...@mosasaur.com That's exactly the kind of user experience I want to avoid. On Jan 13, 2011, at 13:34 , Alexandre Andrade wrote: try to import, and if fails, generate message to user to install it on the system Alexandre Andrade Hipercenter.com Classificados Gratuitos e Inteligentes 2011/1/13 Lorin Rivers lri...@mosasaur.com I am using tabular http://www.parsemydata.com/tabular (which requires numpy), as well as psycopg2 and a number of other libraries. The default location for such things is one of the local site-packages directories, which of course, doesn't migrate to another machine automagically. What's the best practice for this sort of thing? -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lri...@mosasaur.com 512/203.3198 (m) -- Atenciosamente -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lri...@mosasaur.com 512/203.3198 (m)
Re: [web2py] Best practice for including python libraries with my app
On Jan 13, 2011, at 11:49 AM, Lorin Rivers wrote: That's exactly the kind of user experience I want to avoid. You could put a copy in web2py's site-packages, though it'd have to be the right version for the environment (or at least a compatible version). You could put it in your app's modules directory, and use local_import to get it. Or something like this (I haven't checked the syntax; this is just the general idea): try: import somemodule except ImportError: local_import('somemodule') ...so as to get the host's version if it's present, and your backup version if not. On Jan 13, 2011, at 13:34 , Alexandre Andrade wrote: try to import, and if fails, generate message to user to install it on the system Alexandre Andrade Hipercenter.com Classificados Gratuitos e Inteligentes 2011/1/13 Lorin Rivers lriv...@mosasaur.com I am using tabular http://www.parsemydata.com/tabular (which requires numpy), as well as psycopg2 and a number of other libraries. The default location for such things is one of the local site-packages directories, which of course, doesn't migrate to another machine automagically. What's the best practice for this sort of thing? -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m) -- Atenciosamente