I got "global flags not at the start of the expression at position 399 (line 7, column 33)" error while using Nengo

Hey everyone, I am new to using Nengo, and after installing the nengo using ‘pip install nengo nengo-gui’, I gave command ‘nengo’ in the terminal to get started with using nengo, but I got this error saying :

Traceback (most recent call last):
File “”, line 198, in run_module_as_main
File “”, line 88, in run_code
File "C:\Users\srbha\AppData\Local\Programs\Python\Python311\Scripts\nengo.exe_main
.py", line 4, in
File "C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui_init
.py", line 1, in
from .gui import GUI, InteractiveGUI
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui\gui.py”, line 21, in
from nengo_gui.guibackend import GuiServer
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui\guibackend.py”, line 25, in
import nengo_gui.page
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui\page.py”, line 14, in
import nengo_gui.config
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui\config.py”, line 4, in
import nengo_gui.components
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui\components_init_.py”, line 10, in
from .sim_control import SimControl
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui\components\sim_control.py”, line 10, in
from nengo_gui.server import WebSocketFrame
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui\server.py”, line 31, in
from nengo_gui.vendor.cookies import Cookies
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui_vendor\cookies.py”, line 111, in
class Definitions(object):
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\site-packages\nengo_gui_vendor\cookies.py”, line 313, in Definitions
ATTR_RE = re.compile(ATTR)
^^^^^^^^^^^^^^^^
File "C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_init
.py", line 227, in compile
return compile(pattern, flags)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_init
.py", line 294, in _compile
p = _compiler.compile(pattern, flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_compiler.py”, line 743, in compile
p = _parser.parse(p, flags)
^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_parser.py”, line 980, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_parser.py”, line 455, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_parser.py”, line 863, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_parser.py”, line 455, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_parser.py”, line 863, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_parser.py”, line 455, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\srbha\AppData\Local\Programs\Python\Python311\Lib\re_parser.py”, line 841, in _parse
raise source.error('global flags not at the start ’
re.error: global flags not at the start of the expression at position 399 (line 7, column 33)

Try an earlier version of python (e.g. 3.10). I’m seeing this in a clean 3.11 environment, but not in my 3.10 environment.

At first when I got the error, I had the 3.10 version. I thought the error was probably because of older version and upgraded python, but the error persisted.

And the stack trace is identical for the 3.10 error? Can you post it here?

It looks like you’re not currently using conda, which I would highly recommend when you’re trying to set up environments that are dependent on specific Python versions. I’d recommend setting up a 3.10 environment through conda to make sure you’re really using 3.10.

As I said, I’m not seeing this in 3.10, and other places I’ve seen this error online it also appears to be related to 3.11.

When are you planning to support Python 3.11?

I have the same problem: nengo-gui is currently not supported by Python3.11
I would like to use the gui now in order to make some model architecture pics for a publication.
Please update the nengo-gui :))

Kind regards
Bernd

I get the same error message, regardless of whether I use earlier versions of python. I tried with 3.9.2 and 3.6.2.

I switched versions in Anaconda Powershell using Pyenv.

Best,
Jasper