>Could you please copy the whole error message?
<type 'exceptions.ImportError'> Cannot import module
'applications.hydrover_oleodinamica.modules.six' Versione
web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Python Python 2.7.5: /usr/bin/python (prefix: /usr) Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
Traceback (most recent call last):
File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/restricted.py", line 227,
in restricted
exec ccode in environment
File
"/home/tasko/webapps/w2p_2_14_16/web2py/applications/hydrover_oleodinamica/models/0_memcache.py"
<https://prod2.tasko.it/admin/edit/hydrover_oleodinamica/models/0_memcache.py>,
line 2, in <module>
from gluon.contrib.memcache import MemcacheClient
File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/custom_import.py", line
108, in custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
File
"/home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memcache/__init__.py",
line 1, in <module>
from gluon.contrib.memcache.memcache import Client
File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/custom_import.py", line
108, in custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
File
"/home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memcache/memcache.py",
line 60, in <module>
import six
File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/custom_import.py", line
89, in custom_importer
raise ImportError, 'Cannot import module %s' % str(e)
ImportError: Cannot import module
'applications.hydrover_oleodinamica.modules.six'
Error snapshot [image: help]
<https://prod2.tasko.it/admin/ticket/hydrover_oleodinamica/66.249.65.209.2019-07-12.12-02-51.2ddbf7eb-0871-47f1-a2c7-fb13a3a23f2b#>
<type 'exceptions.ImportError'>(Cannot import module
'applications.hydrover_oleodinamica.modules.six')
inspect attributes
Frames
-
*File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/restricted.py in
restricted at line 227* code arguments variables
-
*File
/home/tasko/webapps/w2p_2_14_16/web2py/applications/hydrover_oleodinamica/models/0_memcache.py
in <module> at line 2* code arguments variables
-
*File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/custom_import.py in
custom_importer at line 108* code arguments variables
-
*File
/home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memcache/__init__.py
in <module> at line 1* code arguments variables
-
*File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/custom_import.py in
custom_importer at line 108* code arguments variables
-
*File
/home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memcache/memcache.py
in <module> at line 60* code arguments variables
-
*File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/custom_import.py in
custom_importer at line 89* code arguments variables
Function argument list
(name='six', globals={'__builtins__': {'ArithmeticError': <type
'exceptions.ArithmeticError'>, 'AssertionError': <type
'exceptions.AssertionError'>, 'AttributeError': <type
'exceptions.AttributeError'>, 'BaseException': <type
'exceptions.BaseException'>, 'BufferError': <type
'exceptions.BufferError'>, 'BytesWarning': <type
'exceptions.BytesWarning'>, 'DeprecationWarning': <type
'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>,
'Ellipsis': Ellipsis, 'EnvironmentError': <type
'exceptions.EnvironmentError'>, ...}, '__doc__': None, '__file__': None,
'__name__': None, '__package__': None, 'binascii': None, 'os': None,
'pickle': None, 'print_function': None, 're': None, ...},
locals={'__builtins__': {'ArithmeticError': <type
'exceptions.ArithmeticError'>, 'AssertionError': <type
'exceptions.AssertionError'>, 'AttributeError': <type
'exceptions.AttributeError'>, 'BaseException': <type
'exceptions.BaseException'>, 'BufferError': <type
'exceptions.BufferError'>, 'BytesWarning': <type
'exceptions.BytesWarning'>, 'DeprecationWarning': <type
'exceptions.DeprecationWarning'>, 'EOFError': <type 'exceptions.EOFError'>,
'Ellipsis': Ellipsis, 'EnvironmentError': <type
'exceptions.EnvironmentError'>, ...}, '__doc__': None, '__file__': None,
'__name__': None, '__package__': None, 'binascii': None, 'os': None,
'pickle': None, 'print_function': None, 're': None, ...}, fromlist=[],
level=-1)
Code listing
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
new_mod = base_importer(
modules_prefix, globals, locals, [itemname],
level)
try:
result = result or
sys.modules[modules_prefix+'.'+itemname]
except KeyError, e:
raise ImportError, 'Cannot import module %s' %
str(e)
modules_prefix += "." + itemname
return result
else:
# import like "from x import a, b, ..."
Variables
builtinstr <type 'str'>
builtinImportError <type 'exceptions.ImportError'>
e KeyError('applications.hydrover_oleodinamica.modules.six',)
Context
locals request session response
In file:
/home/tasko/webapps/w2p_2_14_16/web2py/applications/hydrover_oleodinamica/models/0_memcache.py
1.
2.
3.
4.
5.
6.
# -*- coding: utf-8 -*-
from gluon.contrib.memcache import MemcacheClient
memcache_servers = ['127.0.0.1:11211']
cache <https://prod2.tasko.it/examples/global/vars/cache>.memcache =
MemcacheClient(request <https://prod2.tasko.it/examples/global/vars/request>,
memcache_servers)
cache <https://prod2.tasko.it/examples/global/vars/cache>.ram = cache
<https://prod2.tasko.it/examples/global/vars/cache>.disk = cache
<https://prod2.tasko.it/examples/global/vars/cache>.memcache
>Which python version do you use (2 or 3) ?
2
>But in general, yes, I recommend to upgrade to the latest version for
several reasons.
I'm still planing to move to a 2.18.5, I've already installed it but in the
welcome/modules folder there's only the __init__.py file, it's an empty
file.
>The module 'six' is a compatibility layer between API of python2 and
python3 anyway.
That could be the problem.
>I cannot see now why it should be in your apps module dir...
I've got __init__.py and pyc, api_site.pyc, plugin_ckeditor.py and pyc.
Il giorno venerdì 12 luglio 2019 16:04:24 UTC+2, Fekete Zoltán ha scritto:
>
> Could you please copy the whole error message?
> Which python version do you use (2 or 3) ?
>
> But in general, yes, I recommend to upgrade to the latest version for
> several reasons.
>
> The module 'six' is a compatibility layer between API of python2 and
> python3 anyway.
> I cannot see now why it should be in your apps module dir...
>
> Regards,
> FeZ
>
> 2019. július 12., péntek 15:37:08 UTC+2 időpontban Gaël Princivalle a
> következőt írta:
>>
>> Thank you Zoltán.
>>
>> I'm still trying this solution however when I create the 0_memcache.py
>> model file I've got this ticket:
>>
>> <type 'exceptions.ImportError'> Cannot import module
>> 'applications.my_app.modules.six'
>>
>> Could it be due to the fact that the web2py version is the old 2.14.6?
>>
>> Il giorno venerdì 12 luglio 2019 10:46:44 UTC+2, Fekete Zoltán ha scritto:
>>>
>>> Hi Gael,
>>>
>>> It is possible to store sessions in the db, however consider that it
>>> will slow down the system if you have such a high load.
>>>
>>> A faster solution is to store sessions in memory:
>>>
>>> http://web2py.com/books/default/chapter/29/13?search=cache#Sessions-in-memcache
>>>
>>> Read that part of the doc, there are quite a few type of session
>>> handling recipes.
>>>
>>> Regards,
>>>
>>> FeZ
>>>
>>> 2019. július 12., péntek 10:00:03 UTC+2 időpontban Gaël Princivalle a
>>> következőt írta:
>>>>
>>>> Hi all.
>>>>
>>>> In my sessions folder all sessions are stored in separated sub-folders,
>>>> 068,069...
>>>> The file system don't accept more than 512 sub-folders in a folder.
>>>> When I reach 512 sub-folders the website is down.
>>>> Now for avoiding this problem I delete all the sessions with a crontab
>>>> job every 12 hours, but it's not enough.
>>>>
>>>> Obviously I can imagine that deleting all the sessions means also
>>>> disconnecting all the users, that's not a good thing.
>>>>
>>>> Can I store the sessions in the DB instead of the file system?
>>>>
>>>> And what about that? I don't understand where I must add it, and it
>>>> seems that the sessions storage for my website works already like that,
>>>> http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions
>>>>
>>>> Thanks.
>>>>
>>>>
>>>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/f2393c6d-c60e-4f9e-ac50-8071d71ddbcb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.