[web2py] Re: package import

2013-03-21 Thread Phillipp Schmidt
Yes, I restarted a couple of times.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: package import

2013-03-21 Thread Massimo Di Pierro
Did you restart web2py after upgrade?

On Thursday, 21 March 2013 10:38:47 UTC-5, Phillipp Schmidt wrote:
>
> I just updated to this version, but I am still getting the error. Fany 
> interface, though! 
> Do you know any working packages that I could try to see whether it has 
> something to do with my setup?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: package import

2013-03-21 Thread Phillipp Schmidt
I just updated to this version, but I am still getting the error. Fany 
interface, though! 
Do you know any working packages that I could try to see whether it has 
something to do with my setup?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: package import

2013-03-21 Thread Massimo Di Pierro
This was fixed in 2.4.5. What version of web2py are you using?

On Wednesday, 13 March 2013 09:47:38 UTC-5, Phillipp Schmidt wrote:
>
> I want to use the tablib package. https://github.com/kennethreitz/tablib 
> So I put it in the modules folder of my application and use `import 
> tablib`.
> Although the package is working locally, when trying to use it in web2py I 
> keep getting import errors from files inside the package.
> It doesn't seem to support any global imports from inside the module!?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: package import

2013-03-21 Thread Phillipp Schmidt
Thanks for the advice! I checked all the folders and removed some example 
and doc folders that didn't include code. All the other folders contain 
inits. 
Still not working. I wonder if it is intended that way? Can you just put 
packages in modules that make global imports?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: package import

2013-03-20 Thread dlypka
Every folder all the way down within modules and its child folders needs to 
have a __init__.py file.
You are probabaly missing one somewhere there,

On Wednesday, March 20, 2013 5:35:36 AM UTC-5, Phillipp Schmidt wrote:
>
>
> Hi. Could you post the error traceback of the import error? 
>>
> Here is the traceback. My current workaround is to put the package in the 
> web2py site-packages, but it would be great to include it in modules, so I 
> can share the application without telling people to include tablib in their 
> web2py site-packages.
>
> Traceback (most recent call last):
>   File "/home/philsch/web2py/gluon/restricted.py", line 212, in restricted
> exec ccode in environment
>   File "/home/philsch/web2py/applications/sblink/controllers/default.py" 
> , 
> line 88, in 
>   File "/home/philsch/web2py/gluon/globals.py", line 193, in 
> self._caller = lambda f: f()
>   File "/home/philsch/web2py/applications/sblink/controllers/default.py" 
> , 
> line 47, in render
> import applications.sblink.modules.tablib as tablib
>   File "/home/philsch/web2py/gluon/custom_import.py", line 96, in 
> custom_importer
> return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
>   File "applications/sblink/modules/tablib/__init__.py", line 3, in 
> from tablib.core import (
>   File "/home/philsch/web2py/gluon/custom_import.py", line 83, in 
> custom_importer
> return base_importer(pname, globals, locals, fromlist, level)
>   File "applications/sblink/modules/tablib/core.py", line 15, in 
> from tablib import formats
>   File "/home/philsch/web2py/gluon/custom_import.py", line 83, in 
> custom_importer
> return base_importer(pname, globals, locals, fromlist, level)
>   File "applications/sblink/modules/tablib/formats/__init__.py", line 6, in 
> 
> from . import _csv as csv
>   File "/home/philsch/web2py/gluon/custom_import.py", line 96, in 
> custom_importer
> return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
>   File "applications/sblink/modules/tablib/formats/_csv.py", line 6, in 
> 
> from tablib.compat import is_py3, csv, StringIO
>   File "/home/philsch/web2py/gluon/custom_import.py", line 83, in 
> custom_importer
> return base_importer(pname, globals, locals, fromlist, level)
>   File "applications/sblink/modules/tablib/compat.py", line 43, in 
> import tablib.packages.xlwt as xlwt
>   File "/home/philsch/web2py/gluon/custom_import.py", line 77, in 
> custom_importer
> raise ImportError, 'Cannot import module %s' % str(e)
> ImportError: Cannot import module 'tablib'
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: package import

2013-03-20 Thread Phillipp Schmidt


> Hi. Could you post the error traceback of the import error? 
>
Here is the traceback. My current workaround is to put the package in the 
web2py site-packages, but it would be great to include it in modules, so I 
can share the application without telling people to include tablib in their 
web2py site-packages.

Traceback (most recent call last):
  File "/home/philsch/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
  File "/home/philsch/web2py/applications/sblink/controllers/default.py" 
, line 
88, in 
  File "/home/philsch/web2py/gluon/globals.py", line 193, in 
self._caller = lambda f: f()
  File "/home/philsch/web2py/applications/sblink/controllers/default.py" 
, line 
47, in render
import applications.sblink.modules.tablib as tablib
  File "/home/philsch/web2py/gluon/custom_import.py", line 96, in 
custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
  File "applications/sblink/modules/tablib/__init__.py", line 3, in 
from tablib.core import (
  File "/home/philsch/web2py/gluon/custom_import.py", line 83, in 
custom_importer
return base_importer(pname, globals, locals, fromlist, level)
  File "applications/sblink/modules/tablib/core.py", line 15, in 
from tablib import formats
  File "/home/philsch/web2py/gluon/custom_import.py", line 83, in 
custom_importer
return base_importer(pname, globals, locals, fromlist, level)
  File "applications/sblink/modules/tablib/formats/__init__.py", line 6, in 

from . import _csv as csv
  File "/home/philsch/web2py/gluon/custom_import.py", line 96, in 
custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
  File "applications/sblink/modules/tablib/formats/_csv.py", line 6, in 
from tablib.compat import is_py3, csv, StringIO
  File "/home/philsch/web2py/gluon/custom_import.py", line 83, in 
custom_importer
return base_importer(pname, globals, locals, fromlist, level)
  File "applications/sblink/modules/tablib/compat.py", line 43, in 
import tablib.packages.xlwt as xlwt
  File "/home/philsch/web2py/gluon/custom_import.py", line 77, in 
custom_importer
raise ImportError, 'Cannot import module %s' % str(e)
ImportError: Cannot import module 'tablib'

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: package import

2013-03-14 Thread Alan Etkin

>
> It doesn't seem to support any global imports from inside the module!?
>

Hi. Could you post the error traceback of the import error? 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.