Me does a dance. Thanks!
Me does a dance. Thanks!
And yes it makes rain :-)
Also available on pypi, get it while it's hot.
web2py™ | Version 1.96.2 (2011-06-03 16:11:39) |
---|---|
Python | Python 2.5.4: C:\web2py\web2py.exe |
Traceback (most recent call last):
File "gluon/restricted.py", line 184, in restricted
File "C:/web2py/applications/castalia/controllers/default.py", line 2, in <module>
File "gluon/custom_import.py", line 280, in __call__
File "gluon/custom_import.py", line 125, in __call__
ImportError: No module named selfgroup.castalia
Any suggestion?
Thank you
Hi Pierre,this is the output of the code from the web2py application shell:web2py Shell Version 1.96.2 (2011-06-03 16:11:39)In [1] : from selfgroup.castalia import configTraceback (most recent call last):File "gluon/contrib/shell.py", line 233, in runFile "<string>", line 1, in <module>File "gluon/custom_import.py", line 280, in __call__File "gluon/custom_import.py", line 125, in __call__ImportError: No module named selfgroup.castaliaIn [2] : import osIn [3] : print os.stat("C:\web2py\\applications\Castalia\modules\selfgroup\castalia\__init__.py").st_mtime1304593994.0.Thank you very much,Alessandro
Thank you very much for the help!
On 5/6/11 19:51 , Pierre Thibault wrote:
> 2011/6/5 Alessandro Iob <alessan...@gmail.com
> <mailto:alessan...@gmail.com>>
> <http://pierrethibault.posterous.com>
> YouTube page (http://www.youtube.com/user/tubetib)
> <http://www.youtube.com/user/tubetib>
> Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>
>
No, it does not work. And the problem is not related to the _DateTrackerImporter as I'm not using the track_changes options.
I've made some tests and I've found that in _Web2pyImporter.__call__ the code reaches the "import like 'from x import a, b, ...'" section with the vars set to:
name = selfgroup.castaliacaller_file_name = C:\w2p\web2py\applications\castalia\controllers/default.pyself.web2py_path = C:\w2p\web2pymatch_app_dir = <_sre.SRE_Match object at 0x018B7420>modules_prefix = applications.castalia.modulesmodule_prefix + '.' + name = applications.castalia.modules.selfgroup.castaliafromlist = ('config',)level = -1then the call tosuper(_Web2pyImporter, self).__call__(modules_prefix+"."+name, globals, locals, fromlist, level)
raises the ImportError exception (No module named castalia.modules.selfgroup.castalia).The sys.path seems correct:
['', 'C:\\w2p\\web2py\\site-packages', 'C:\\w2p\\web2py', 'C:\\w2p\\web2py\\gluon', 'C:\\w2p\\web2py\\library.zip']No clue.
On 6/6/11 15:42 , Pierre Thibault wrote:
> 2011/6/6 Alessandro Iob <alessan...@gmail.com
> <mailto:alessan...@gmail.com>>
>
> No, it does not work. And the problem is not related to the
> *_DateTrackerImporter as I'm not using the track_changes options.*
>
> **I've made some tests and I've found that in
> *applications*.castalia.modules.selfgroup.castalia".
>
> Why is "applicaitons" missing?
>
> --
>
>
> A+
>
> -------------
> Pierre
> My blog and profile (http://pierrethibault.posterous.com)
I really do not know why, but that's the error. A mistery for me.
I do not understand this line:
does not look like a valid Python statement to me.
module_prefix + '.' + name =
applications.castalia.modules.selfgroup.castalia
--
On 6/6/11 16:05 , Pierre Thibault wrote:
> 2011/6/6 Alessandro Iob <alessan...@gmail.com
> <mailto:alessan...@gmail.com>>
>
> I really do not know why, but that's the error. A mistery for me.
>
>
>
> Can you trace the super call?
>
> On 6/6/11 15:42 , Pierre Thibault wrote:
>
> 2011/6/6 Alessandro Iob <alessan...@gmail.com
> <mailto:alessan...@gmail.com>
> <mailto:alessan...@gmail.com <mailto:alessan...@gmail.com>>>
I'll try, but the super is really just the standard __import__ method.
On 6/6/11 16:37 , Pierre Thibault wrote:
> 2011/6/6 Alessandro Iob <alessan...@gmail.com
> <mailto:alessan...@gmail.com>>
>
> I'll try, but the super is really just the standard __import__ method.
>
>
>
> What is the value of name there?
> --
>
>
> A+
>
> -------------
> Pierre
> My blog and profile (http://pierrethibault.posterous.com)
the name arg passed to _PYTHON_STANDARD_IMPORTER has value
"applications.castalia.modules.selfgroup.castalia".
I've also created a simple module under applications/castalia/modules
but I can not import it too.
I've tried from the python shell to import using
applications.Castalia..... and it worked.
On 6/6/11 17:06 , Pierre Thibault wrote:
Found something: the application folder is named 'Castalia' with the first char in uppercase, while the importer tries to import it as 'applications.castalia....', in lowercase.
I've tried from the python shell to import using applications.Castalia..... and it worked.
On 6/6/11 17:44 , Pierre Thibault wrote:
> 2011/6/6 Alessandro Iob <alessan...@gmail.com
> <mailto:alessan...@gmail.com>>
>
> Found something: the application folder is named 'Castalia' with the
> first char in uppercase, while the importer tries to import it as
> 'applications.castalia....', in lowercase.
>
> I've tried from the python shell to import using
> applications.Castalia..... and it worked.
>
>
> Problem solved?
>
>
> --
>
>
> A+
>
> -------------
> Pierre
> My blog and profile (http://pierrethibault.posterous.com)
No, it does not work. And the problem is not related to the _DateTrackerImporter as I'm not using the track_changes options.
I've made some tests and I've found that in _Web2pyImporter.__call__ the code reaches the "import like 'from x import a, b, ...'" section with the vars set to:
name = selfgroup.castaliacaller_file_name = C:\w2p\web2py\applications\castalia\controllers/default.pyself.web2py_path = C:\w2p\web2pymatch_app_dir = <_sre.SRE_Match object at 0x018B7420>modules_prefix = applications.castalia.modulesmodule_prefix + '.' + name = applications.castalia.modules.selfgroup.castaliafromlist = ('config',)level = -1then the call tosuper(_Web2pyImporter, self).__call__(modules_prefix+"."+name, globals, locals, fromlist, level)
raises the ImportError exception (No module named castalia.modules.selfgroup.castalia).The sys.path seems correct:
['', 'C:\\w2p\\web2py\\site-packages', 'C:\\w2p\\web2py', 'C:\\w2p\\web2py\\gluon', 'C:\\w2p\\web2py\\library.zip']No clue.
On 6/6/11 21:35 , Pierre Thibault wrote:
> 2011/6/6 Alessandro Iob <alessan...@gmail.com
> <mailto:alessan...@gmail.com>>
>
> No, it does not work. And the problem is not related to the
> *_DateTrackerImporter as I'm not using the track_changes options.*
>
> **I've made some tests and I've found that in
import os
os.environ['PYTHONCASEOK'] = '1'
It makes ignore path case on operating systems with case-insensitive
file-systems (namely Win32 and OS/X with the default fs).
Do you think it should be added, with a proper os test, to the importer
code?
On 6/6/11 21:35 , Pierre Thibault wrote:
> 2011/6/6 Alessandro Iob <alessan...@gmail.com
> <mailto:alessan...@gmail.com>>
>
> No, it does not work. And the problem is not related to the
> *_DateTrackerImporter as I'm not using the track_changes options.*
>
> **I've made some tests and I've found that in
I have fixed the problem adding the following code in one of my models:
import os
os.environ['PYTHONCASEOK'] = '1'
It makes ignore path case on operating systems with case-insensitive file-systems (namely Win32 and OS/X with the default fs).
Do you think it should be added, with a proper os test, to the importer code?