question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3.10 support

See original GitHub issue

In this PR about PEP-6222 I created an experimental build of Python 3.10 that is available at this binder link. However if I install IPython using py10 -m pip install IPython and then try to use it, eventually I get a crash. I’ll post the details in a comment below so we keep the top-level issue description simple. It would be great to track 3.10 compatibility, if possible, so we can use IPython for testing/experimenting with new features and ideas (though I realize that may be a big lift in that it’s tracking quite a moving target).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mtovmassiancommented, May 25, 2022

@MrMino Maybe not necessary since the problem disappeared after re-installing Python 3.10.4. This time when doing pip install ipython IPython came with version 0.8.0 of parso lib.

1reaction
fperezcommented, Jun 30, 2020

Here’s an example of the crash that results from %run test_patma.py in the binder link above. I

In [6]: run test_patma.py                                                                                                          
Traceback (most recent call last):
  File "/home/jovyan/.local/lib/python3.10/site-packages/jedi/cache.py", line 109, in wrapper
    return dct[key]
KeyError: ((), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/terminal/ptutils.py", line 113, in get_completions
    yield from self._get_completions(body, offset, cursor_position, self.ipy_completer)
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/terminal/ptutils.py", line 126, in _get_completions
    for c in completions:
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/core/completer.py", line 438, in _deduplicate_completions
    completions = list(completions)
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/core/completer.py", line 1818, in completions
    for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/core/completer.py", line 1861, in _completions
    matched_text, matches, matches_origin, jedi_matches = self._complete(
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/core/completer.py", line 2029, in _complete
    completions = self._jedi_matches(
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/core/completer.py", line 1373, in _jedi_matches
    interpreter = jedi.Interpreter(
  File "/home/jovyan/.local/lib/python3.10/site-packages/jedi/api/__init__.py", line 858, in __init__
    super(Interpreter, self).__init__(code, environment=environment,
  File "/home/jovyan/.local/lib/python3.10/site-packages/jedi/api/__init__.py", line 184, in __init__
    self._inference_state = InferenceState(
  File "/home/jovyan/.local/lib/python3.10/site-packages/jedi/inference/__init__.py", line 91, in __init__
    self.grammar = environment.get_grammar()
  File "/home/jovyan/.local/lib/python3.10/site-packages/jedi/cache.py", line 111, in wrapper
    result = method(self, *args, **kwargs)
  File "/home/jovyan/.local/lib/python3.10/site-packages/jedi/api/environment.py", line 37, in get_grammar
    return parso.load_grammar(version=version_string)
  File "/home/jovyan/.local/lib/python3.10/site-packages/parso/grammar.py", line 260, in load_grammar
    return load_grammar(**kwargs)
  File "/home/jovyan/.local/lib/python3.10/site-packages/parso/grammar.py", line 236, in load_grammar
    version_info = parse_version_string(version)
  File "/home/jovyan/.local/lib/python3.10/site-packages/parso/utils.py", line 176, in parse_version_string
    return _parse_version(version)
  File "/home/jovyan/.local/lib/python3.10/site-packages/parso/utils.py", line 125, in _parse_version
    raise ValueError('The given version is not in the right format. '
ValueError: The given version is not in the right format. Use something like "3.8" or "3".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jovyan/.local/bin/ipython", line 8, in <module>
    sys.exit(start_ipython())
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/__init__.py", line 126, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/home/jovyan/.local/lib/python3.10/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/terminal/ipapp.py", line 356, in start
    self.shell.mainloop()
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 563, in mainloop
    self.interact()
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 546, in interact
    code = self.prompt_for_code()
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 472, in prompt_for_code
    text = self.pt_app.prompt(
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/shortcuts/prompt.py", line 994, in prompt
    return self.app.run(set_exception_handler=set_exception_handler)
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 811, in run
    return loop.run_until_complete(
  File "/home/jovyan/.local/lib/python3.10/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 778, in run_async
    return await _run_async2()
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 766, in _run_async2
    await self.cancel_and_wait_for_background_tasks()
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 867, in cancel_and_wait_for_background_tasks
    await task
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/buffer.py", line 1854, in new_coroutine
    await coroutine(*a, **kw)
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/buffer.py", line 1683, in async_completer
    async for completion in self.completer.get_completions_async(
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/completion/base.py", line 269, in get_completions_async
    async for completion in completer.get_completions_async(
  File "/home/jovyan/.local/lib/python3.10/site-packages/prompt_toolkit/completion/base.py", line 196, in get_completions_async
    for item in self.get_completions(document, complete_event):
  File "/home/jovyan/.local/lib/python3.10/site-packages/IPython/terminal/ptutils.py", line 116, in get_completions
    print_tb(e)
  File "/home/jovyan/.local/lib/python3.10/traceback.py", line 53, in print_tb
    print_list(extract_tb(tb, limit=limit), file=file)
  File "/home/jovyan/.local/lib/python3.10/traceback.py", line 72, in extract_tb
    return StackSummary.extract(walk_tb(tb), limit=limit)
  File "/home/jovyan/.local/lib/python3.10/traceback.py", line 347, in extract
    for f, lineno in frame_gen:
  File "/home/jovyan/.local/lib/python3.10/traceback.py", line 312, in walk_tb
    yield tb.tb_frame, tb.tb_lineno
AttributeError: 'ValueError' object has no attribute 'tb_frame'

It seems that something changed in the structure of exception/traceback objects. There may be other issues as well, this is just the first problem I saw.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 3.10 support table for most popular Python packages
Python 3.10 is a currently supported version of Python . This site shows Python 3.10 support for the 360 most downloaded packages on...
Read more >
What's New In Python 3.10 — Python 3.11.1 documentation
Sequence patterns support wildcards: [x, y, *rest] and (x, y, *rest) work similar to wildcards in unpacking assignments. The name after * may...
Read more >
Support Python 3.10? - General Discussion - TensorFlow Forum
Python 3.10 will be released in October 2021, so it will be supported in the next TF release after that, assuming all dependencies...
Read more >
When should you upgrade to Python 3.11?
Apparently it took them 6 months post-release until they had Python 3.9 support, and 3 months after 3.10. For my own projects, some...
Read more >
add python 3.10 support · Issue #69440 · pytorch ... - GitHub
Feature Add Python 3.10 support, since PyTorch only supports up to Python 3.9.9 as of the time I'm writing this.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found