ciao!
ho installato cherrypy per studiarlo un pò:
codice:
# pip3 install cherrypy
non ha dato errori.
però se provo questo comando (python default 2.7):
codice:
$ python -m cherrypy.tutorial.tut01_helloworld
[10/Oct/2016:18:08:02] ENGINE Listening for SIGHUP.
[10/Oct/2016:18:08:02] ENGINE Listening for SIGTERM.
[10/Oct/2016:18:08:02] ENGINE Listening for SIGUSR1.
[10/Oct/2016:18:08:02] ENGINE Bus STARTING
[10/Oct/2016:18:08:02] ENGINE Started monitor thread 'Autoreloader'.
[10/Oct/2016:18:08:02] ENGINE Started monitor thread '_TimeoutMonitor'.
[10/Oct/2016:18:08:02] ENGINE Serving on http://127.0.0.1:8080
[10/Oct/2016:18:08:02] ENGINE Bus STARTED
ma se vado su http://127.0.0.1:8080/ ottengo un Errore di caricamento pagina.
mentre specificando python3:
codice:
$ python3 -m cherrypy.tutorial.tut01_helloworld
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.4/dist-packages/cherrypy/tutorial/tut01_helloworld.py", line 34, in <module>
cherrypy.quickstart(HelloWorld(), config=tutconf)
File "/usr/local/lib/python3.4/dist-packages/cherrypy/__init__.py", line 180, in quickstart
_global_conf_alias.update(config)
File "/usr/local/lib/python3.4/dist-packages/cherrypy/_cpconfig.py", line 158, in update
reprconf.Config.update(self, config)
File "/usr/local/lib/python3.4/dist-packages/cherrypy/lib/reprconf.py", line 155, in update
config = Parser().dict_from_file(config)
File "/usr/local/lib/python3.4/dist-packages/cherrypy/lib/reprconf.py", line 227, in dict_from_file
self.read(file)
File "/usr/local/lib/python3.4/dist-packages/cherrypy/lib/reprconf.py", line 197, in read
fp = open(filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.4/dist-packages/cherrypy/tutorial/tutorial.conf'
come devo fare per usare cherrypy con python3?