Take a look to pyenv or nix to install a python version apart from the
system

On Mon, Feb 5, 2024 at 5:37 PM apinho <jaapi...@sapo.pt> wrote:

> Hello everyone,
>
> I just migrated an old (2017-ish) web2py app, which was still hosted on a
> user machine, running on Rocket HTTP server.
>
> The app is now on a CentOS 7 VM, under nginx/uwsgi using HTTPS.
> Web2py version is 2.27.1, over Python 2.7.5, in a virtualenv.
>
> All is OK as for the app itself, but now I as trying to setup cron to to
> delete old sessions, and I'm stuck with this :
> *$ python web2py.py -S <myapp> -M -R scripts/sessions2trash.py -A -o -X
> 3600 -f -v*
> Traceback (most recent call last):
>   File "web2py.py", line 44, in <module>
>     import gluon.widget
>   File "/home/apinho/web2py/web2py/gluon/widget.py", line 28, in <module>
>     from gluon.console import console, is_appdir
>   File "/home/apinho/web2py/web2py/gluon/console.py", line 53, in <module>
>     from gluon.shell import die
>   File "/home/apinho/web2py/web2py/gluon/shell.py", line 305
>     exec(read_pyc(pycfile), _env)
> SyntaxError: unqualified exec is not allowed in function 'run' it contains
> a nested function with free variables
>
> I really have no clue what to do. There is little help online. The only
> one I could find says that upgrading to Python 2.7.18 would do the trick,
> but that would most probably wreck Centos7 (Which I am stuck with, for it
> is my company's mandatory Linux distro for production environments).
>
> Any help would be much appreciated.
> Alexandre
>
> --
> 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/575fdca2-1b6d-4107-8b99-9c5eeeee5a30n%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/575fdca2-1b6d-4107-8b99-9c5eeeee5a30n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Massimiliano

-- 
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/CANPTPx%2BYU7aQD6KwEsvH1MUwAcOZMNmt7itRHbc_BFkYOmKDCw%40mail.gmail.com.

Reply via email to