#1 Fri 29 May 2009 14:20
- Remi01
- Participant actif
- Date d'inscription: 18 Jan 2007
- Messages: 75
[Tilecache/Mod_Python] No module named TileCache.Service
Bonjour à tous,
L'utilisation du mod_python me pose problème ...
J'ai testé l'install de python (hello world et testhandler.py) et ça fonctionne...
Dans mon log Apache, j'ai toute une série d'erreurs, et notamment celle-ci :
Code:
ImportError: No module named TileCache.Service, referer: http://localhost/openlayers/
Voila mon fichier de configuration httpd_tilecache.conf
Code:
Alias /tilecache/ "C:/ms4w/apps/tilecache/"
<Directory "C:/ms4w/apps/tilecache/">
AllowOverride None
Options Indexes FollowSymLinks Multiviews
Order allow,deny
Allow from all
Options -Indexes
</Directory>
<Directory "C:/ms4w/apps/tilecache/">
AddHandler python-program .py
PythonPath "['C:/ms4w/apps/tilecache/TileCache/'] + sys.path"
#PythonHandler mod_python.testhandler
PythonHandler TileCache.Service
PythonOption TileCacheConfig "C:/ms4w/apps/tilecache/tilecache.cfg"
</Directory>Il me semble qu'il ne trouve pas le fichier Service.py, qui se touve dans C:/ms4w/apps/tilecache/TileCache/ et ce malgré la définition du PythonPath (PythonPath "['C:/ms4w/apps/tilecache/TileCache/'] + sys.path").
Lorsque je décommente la ligne "PythonHandler mod_python.testhandler", celui ci est bien trouvé alors qu'il se situe dans "C:\Python25\Lib\site-packages\mod_python\"
Tout ceci m'amène à penser que Service.py est recherché dans ce même dossier, hypothèse qui semble confirmée lorsque je copie le dossier TileCache dans C:\Python25\Lib\site-packages\mod_python, où cette erreur disparait.
Je présume donc qu'il faut que je définisse le PythonPath correctement mais je ne sais pas vraiment comment faire ...
Auriez vous des pistes ?
Merci
Rémi
Dernière modification par Remi01 (Fri 29 May 2009 14:30)
Hors ligne
#2 Fri 29 May 2009 14:35
Re: [Tilecache/Mod_Python] No module named TileCache.Service
Bonjour,
Visiblement mettre deuxfois le directory doit poser problème quelques part ![]()
voici ma config :
Code:
Alias /tilecache /var/www/test/Carto/tilecache-2.01/
<Directory "/var/www/test/Carto/tilecache-2.01/">
AddHandler python-program .py
PythonHandler TileCache.Service
PythonOption TileCacheConfig /var/www/test/Carto/cgi/tilecache.cfg
PythonPath "['/var/www//test/Carto/tilecache-2.01/'] + sys.path"
PythonDebug On
Order allow,deny
Allow from all
</Directory>Y.
Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !! - GeoRezo vous aide ? Aidez GeoRezo !
Hors ligne
#3 Fri 29 May 2009 14:46
- Remi01
- Participant actif
- Date d'inscription: 18 Jan 2007
- Messages: 75
Re: [Tilecache/Mod_Python] No module named TileCache.Service
Merci Yves!
Effectivement, sans doute
je pensais pouvoir en déclarer plusieurs !
Ma nouvelle config est donc :
Code:
Alias /tilecache/ "C:/ms4w/apps/tilecache/"
<Directory "C:/ms4w/apps/tilecache/">
AddHandler python-program .py
PythonHandler TileCache.Service
PythonOption TileCacheConfig "C:/ms4w/apps/tilecache/tilecache.cfg"
PythonPath "['C:/ms4w/apps/tilecache/'] + sys.path"
PythonDebug On
Order allow,deny
Allow from all
#PythonHandler mod_python.testhandler
</Directory>Mais j'ai l'erreur suivante lorsque je tente d'accéder à une tuiles :
Code:
MOD_PYTHON ERROR
ProcessId: 5544
Interpreter: 'localhost.local.domain'
ServerName: 'localhost.local.domain'
DocumentRoot: 'C:/ms4w/Apache/htdocs'
URI: '/tilecache/tilecache.py'
Location: None
Directory: 'C:/ms4w/apps/tilecache/'
Filename: 'C:/ms4w/apps/tilecache/tilecache.py'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'TileCache.Service'
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1202, in _process_target
module = import_module(module_name, path=path)
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 304, in import_module
return __import__(module_name, {}, {}, ['*'])
ImportError: No module named TileCache.Service...et le log Apache reste le même ...
Hors ligne
#4 Fri 29 May 2009 16:39
- Remi01
- Participant actif
- Date d'inscription: 18 Jan 2007
- Messages: 75
Re: [Tilecache/Mod_Python] No module named TileCache.Service
Voila la conf qui marche pour moi
(Yahou!)
Code:
Alias /tilecache_folder/ "C:/ms4w/apps/tilecache/"
<Directory "C:/ms4w/apps/tilecache">
PythonPath "['C:/ms4w/apps/tilecache'] + sys.path"
AddHandler python-program .py
PythonHandler TileCache.Service
PythonOption TileCacheConfig "C:/ms4w/apps/tilecache/tilecache.cfg"
PythonDebug On
Order allow,deny
Allow from all
</Directory>Bon week end !
Dernière modification par Remi01 (Fri 29 May 2009 16:40)
Hors ligne


