Jupyter invalid syntax

I tried to run Jupyter it gives me this error

File “/usr/local/bin/jupyter-notebook”, line 11, in
sys.exit(main())
File “/usr/local/lib/python3.7/dist-packages/jupyter_core/application.py”, line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py”, line 657, in launch_instance
app.initialize(argv)
File “”, line 2, in initialize
File “/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py”, line 87, in catch_config_error
return method(app, *args, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/notebook/notebookapp.py”, line 1629, in initialize
self.init_webapp()
File “/usr/local/lib/python3.7/dist-packages/notebook/notebookapp.py”, line 1379, in init_webapp
self.jinja_environment_options,
File “/usr/local/lib/python3.7/dist-packages/notebook/notebookapp.py”, line 158, in init
default_url, settings_overrides, jinja_env_options)
File “/usr/local/lib/python3.7/dist-packages/notebook/notebookapp.py”, line 270, in init_settings
nbextensions_path=jupyter_app.nbextensions_path,
File “/usr/local/lib/python3.7/dist-packages/notebook/notebookapp.py”, line 1066, in nbextensions_path
from IPython.paths import get_ipython_dir
File “/usr/local/lib/python3.7/dist-packages/IPython/init.py”, line 54, in
from .core.application import Application
File “/usr/local/lib/python3.7/dist-packages/IPython/core/application.py”, line 25, in
from IPython.core import release, crashhandler
File “/usr/local/lib/python3.7/dist-packages/IPython/core/crashhandler.py”, line 27, in
from IPython.core import ultratb
File “/usr/local/lib/python3.7/dist-packages/IPython/core/ultratb.py”, line 119, in
from IPython.utils import path as util_path
File “/usr/local/lib/python3.7/dist-packages/IPython/utils/path.py”, line 17, in
from IPython.utils.process import system
File “/usr/local/lib/python3.7/dist-packages/IPython/utils/process.py”, line 19, in
from ._process_posix import system, getoutput, arg_split, check_pid
File “/usr/local/lib/python3.7/dist-packages/IPython/utils/_process_posix.py”, line 23, in
import pexpect
File “/usr/lib/python3/dist-packages/pexpect/init.py”, line 75, in
from .pty_spawn import spawn, spawnu
File “/usr/lib/python3/dist-packages/pexpect/pty_spawn.py”, line 15, in
from .spawnbase import SpawnBase
File “/usr/lib/python3/dist-packages/pexpect/spawnbase.py”, line 218
def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
^
SyntaxError: invalid syntax

@Hawk_24700,

This was a known issue with certain installation methods. Are you using pipenv by chance? If so, please upgrade your pipenv. Otherwise please follow up with your python environment.

Nathan