I have a windows 10 PC. I installed c:\python27 and c:\python3 and they are working. I can choose.
But if I try to start web2py it happens this error: c:\Python3>python.exe c:\web2py\web2py.py Traceback (most recent call last): File "c:\web2py\web2py.py", line 21, in <module> import gluon.widget File "c:\web2py\gluon\__init__.py", line 37, in <module> from .globals import current File "c:\web2py\gluon\globals.py", line 24, in <module> from gluon.serializers import json, custom_json File "c:\web2py\gluon\serializers.py", line 10, in <module> from gluon.languages import lazyT File "c:\web2py\gluon\languages.py", line 19, in <module> from cgi import escape ImportError: cannot import name 'escape' from 'cgi' (c:\Python3\lib\cgi.py) I found that changing "from cgi import escape" to "from html import escape" it start but I don't knoy why. Nevertheless If I try to start an app built from Python27 I have this error: <type 'exceptions.RuntimeError'> Failure to connect, tried 5 times: Traceback (most recent call last): File "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__ self._adapter = adapter(**kwargs) File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__ self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in reconnect self.connection = self.connector() File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in connector return self.driver.connect(**self.driver_args) File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return Connection(*args, **kwargs) File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__ self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect self._get_server_information() File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in _get_server_information self.server_charset = charset_by_id(lang).name File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return self._by_id[id] KeyError: 255 If I start the same app with web2py on python 2.7 changing back to "from cgi import escape" and it's working. Maybe this is a problem regarding foreign-keys, I had one time in the past but.... really... I don't remember how to fix. Thank you Il giorno venerdì 20 marzo 2020 22:05:59 UTC+1, Jonathan Clark ha scritto: > > Definitely if you're using the rocket web server. There are various ways > to run different versions of python on the same machine but it depends on > your OS how to do it. Once you can run different pythons, you can run > different versions of web2py at the same time, but you will need to use > different ports e.g. 8080, 8081 etc. to direct the traffic to the right > web2py instance. That's without Apache. > > I also run different web2py instances behind the same Apache instance on a > virtual host, but I have set up Apache to forward virtual host one to one > port (using .htaccess), and virtual host two to a different port. The > rocket server in web2py in each instance is told which port it should > respond to. So the browser looks for www.hostone.com, .htaccess forwards > that to port number 65789, and a web2py instance is run to service requests > to port 65789. For hosttwo, the port number changes. > > Here is a snippet of a .htacces file which does what I want: > > RewriteCond %{HTTP_HOST} hostone.com$ > RewriteRule ^(.*)$ https://127.0.0.1:65789/$1 [P,QSA,L] > > (There is another redirect which directs www.hostone.com to hostone.com). > > > On Saturday, 14 March 2020 19:06:20 UTC, Andrea Fae' wrote: >> >> Is it possible to have 2 differents environment on the same PC? >> web2py running python2.7 and web2py running ppython 3 separated...? >> Thank you >> > -- 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 web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/74c4d214-c657-4a99-b8a5-0582199f24c9%40googlegroups.com.