ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

876 views
Skip to first unread message

Omicron VT

unread,
Nov 1, 2017, 8:17:45 AM11/1/17
to web2py-users
I have been using websocket_messaging.py without problems in version 2.14.6. After upgrading to 2.15.4 i can not start websocket_messaging anymore, iget this error :
ImportError: No module named gluon.utils

Any help ? Thanks

黄祥

unread,
Nov 1, 2017, 9:00:30 AM11/1/17
to web2py-users
had you try:
from gluon import utils

best regards,
stifan

Omicron VT

unread,
Nov 1, 2017, 9:19:02 AM11/1/17
to web2py-users

Yes, but no solution.

I think this lines(96-97) in messaging_websocket.py are the problem :
import gluon.utils
from gluon._compat import to_native, to_bytes, urlencode, urlopen

and if i try to import /gluon/utils.py from python console i get a similar error:
  File "utils.py", line 30, in <module>
    from gluon._compat import basestring, pickle, PY2, xrange, to_bytes, to_native
ImportError: No module named gluon._compat


Massimo Di Pierro

unread,
Nov 1, 2017, 7:57:21 PM11/1/17
to web2py-users
make sure web2py is in PYTHON_PATH

Luciano Bovio

unread,
Nov 2, 2017, 8:20:14 AM11/2/17
to web...@googlegroups.com
El 01/11/17 a las 20:57, Massimo Di Pierro escribió:
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/A3kbW7AZS7g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+un...@googlegroups.com
> <mailto:web2py+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Thanks, but no solution.



To reproduce my problem :
Fresh Debian 9
Download web2py sources for normal users
Unzip web2py to some folder
Install tornado with pip
Cd to web2py folder
Run gluon/contrib/websocket_messaging.py -k mykey -p 8888

This is console output:
root@debian9:~/web2py# python gluon/contrib/websocket_messaging.py -k
mykey -p 8888
Traceback (most recent call last):
File "gluon/contrib/websocket_messaging.py", line 96, in <module>
import gluon.utils
ImportError: No module named gluon.utils

On my Ubuntu working desktop the problem is the same.
If i use an older version of web2py, websocket_messaging works.




Omicron VT

unread,
Nov 3, 2017, 7:39:52 PM11/3/17
to web2py-users
Answer to myself:

Maybe solution to problem1 of this issue is the key : https://github.com/web2py/web2py/issues/1696


El miércoles, 1 de noviembre de 2017, 9:17:45 (UTC-3), Omicron VT escribió:

Thiago Gomes

unread,
Aug 7, 2019, 11:03:16 AM8/7/19
to web2py-users
make sure web2py is in PYTHONPATH
Reply all
Reply to author
Forward
0 new messages