Hello,
I'm trying to convert my web2py apps to Ubuntu 20.4 / apache2/wsgi using python 3.8.5, and as I'm not an IT expert, the only way I found was to change the import instructions in a series of modules. I am aware I shouldn't do this, but I couldn't find any alternative...
I would apreciate getting any feedback with another solution, and/or corrections of my 'durty coding'.
Action 1:
- usr/lib/python3/dist-packages/yaml___init.py - line 399:
replace def class YAMLObject(metaclass=YAMLObjectMetaclass):
by
def class YAMLObject:
__metaclass__=YAMLObjectMetaclass
Action 2:
create /etc/securetty file (there was an example of content of this file in /usr/share/doc/util-linux/examples/securetty)
Action 3:
add following line in /homr/www-data/web2py/gulon/packages/dal/pydal/adapters/base.py, line 16:
if not '/usr/lib/python3/dist-packages' in sys.path:
sys.path.append(''/usr/lib/python3/dist-packages')
Action 4:
This 'import' instrunction of python is incompatible with the previous version. In each module (for instance gluon), the import of 'brother modules' (modules in the same folder than gluon) are done with the following type of instruction: 'from gluon import xxx'
This doesn't work in my configuration, because import instructions starting with a 'from' are supposed to refer to the relative path of the module, and not the absolute path (which scans sys.path).
=> this instrunction must be changed (for instance by 'from .gluon import xxx')
I am still working to get my system running, but at least, I can start web2py...
I do not want to enter into phylosophical discussion about what I am authorized to do or not, and I hope that in early 2021, the evolution of ubuntu, python, web2py and other usefull packages will take care to keep harmony in the strategy of their evolution.