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.

IPython 8.1.0 claims to be compatible with Python 3.8, but isn't

See original GitHub issue

Steps to reproduce:

$ python --version
Python 3.8.10
$ pip install ipython
$ ipython
Traceback (most recent call last):
  File "/path/to/venv/bin/ipython", line 8, in <module>
    sys.exit(start_ipython())
  File "/path/to/venv/lib/python3.8/site-packages/IPython/__init__.py", line 123, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/path/to/venv/lib/python3.8/site-packages/traitlets/config/application.py", line 845, in launch_instance
    app.initialize(argv)
  File "/path/to/venv/lib/python3.8/site-packages/traitlets/config/application.py", line 88, in inner
    return method(app, *args, **kwargs)
  File "/path/to/venv/lib/python3.8/site-packages/IPython/terminal/ipapp.py", line 279, in initialize
    self.init_shell()
  File "/path/to/venv/lib/python3.8/site-packages/IPython/terminal/ipapp.py", line 293, in init_shell
    self.shell = self.interactive_shell_class.instance(parent=self,
  File "/path/to/venv/lib/python3.8/site-packages/traitlets/config/configurable.py", line 540, in instance
    inst = cls(*args, **kwargs)
  File "/path/to/venv/lib/python3.8/site-packages/IPython/terminal/interactiveshell.py", line 619, in __init__
    super(TerminalInteractiveShell, self).__init__(*args, **kwargs)
  File "/path/to/venv/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 529, in __init__
    self.init_virtualenv()
  File "/path/to/venv/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 788, in init_virtualenv
    new_path = p.readlink()
AttributeError: 'PosixPath' object has no attribute 'readlink'

If you suspect this is an IPython 8.1.0 bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

PosixPath.readlink() was introduced in Python 3.9.

Thank you for looking into this.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:31
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

22reactions
dgealowcommented, Feb 28, 2022

For anyone who wants a workaround for the next few days but doesn’t want to muck around with source files and/or doesn’t care about whatever other features/fixes 8.1 added, you can just downgrade to the previous version: pip install ipython==8.0.1

11reactions
olliemathcommented, Feb 25, 2022

Can confirm

sed -i 's/p.readlink()/p._from_parts(os.readlink(p,))/g' IPython/core/interactiveshell.py

within my local venv fixed this for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing IPython — IPython 8.7.0 documentation
This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower ...
Read more >
ipython reads wrong python version - Stack Overflow
I noticed that running Python, uses version 2.7. 2 and does import scipy, matplotlib, and numpy, but on iPython the version is 2.7....
Read more >
Having issues pip installing? - Discussions on Python.org
I have Python 3.9.6. I am considering the PyPI method but I hope to at least understand why SpeechRecogniton isn't downloading.
Read more >
When should you upgrade to Python 3.11?
The problems with a new major Python release. As with many open source projects, Python, Python libraries, and most of the toolchain and...
Read more >
Changes — Click Documentation (8.1.x)
Version 8.1.0¶ · Drop support for Python 3.6. · Remove previously deprecated code. · Rely on PEP 538 and PEP 540 to handle...
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