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.

html.py conflict with html module

See original GitHub issue

find that html.py is conflict with python html module. that is why when execute IPython.__main__.py, this error appears:

 python __main__.py 
/Users/suoyi/Documents/GitHub/ipython/IPython/html.py:12: ShimWarning: The `IPython.html` package has been deprecated since IPython 4.0. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
  warn("The `IPython.html` package has been deprecated since IPython 4.0. "
Traceback (most recent call last):
  File "/Users/suoyi/Documents/GitHub/ipython/IPython/__main__.py", line 12, in <module>
    from IPython import start_ipython
  File "/Users/suoyi/miniconda3/envs/ipython/lib/python3.9/site-packages/IPython/__init__.py", line 56, in <module>
    from .terminal.embed import embed
  File "/Users/suoyi/miniconda3/envs/ipython/lib/python3.9/site-packages/IPython/terminal/embed.py", line 15, in <module>
    from IPython.core.interactiveshell import DummyMod, InteractiveShell
  File "/Users/suoyi/miniconda3/envs/ipython/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 60, in <module>
    from IPython.display import display
  File "/Users/suoyi/miniconda3/envs/ipython/lib/python3.9/site-packages/IPython/display.py", line 16, in <module>
    from IPython.lib.display import *
  File "/Users/suoyi/miniconda3/envs/ipython/lib/python3.9/site-packages/IPython/lib/display.py", line 5, in <module>
    from html import escape as html_escape
ImportError: cannot import name 'escape' from 'html' (/Users/suoyi/Documents/GitHub/ipython/IPython/html.py)

when remove html.py, this error disappear. can you fix this by renaming this file?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bollwyvlcommented, Aug 18, 2021

Hah, didn’t even read it: The `IPython.html` package has been deprecated since IPython 4.0.

Kill it with 🔥 !

0reactions
Carreaucommented, Aug 18, 2021

Ah, sorry it’s the opposite, it’s trying to import the local html.py instead of the global one.

Sure, let’s nuke html.py.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Local scripts conflict with builtin modules when loading numpy
It means that import math always tries to import the math module, rather than the old behavior of trying currentpackage.math first if the...
Read more >
python: name conflict with built-in module - Blog
sometimes a custom python module may have a name that is the same as a built-inmodule; and it sucks when you find the...
Read more >
Block package names that conflict with core libraries #2151
I am aware of the standard library module index at https://docs.python.org/3/py-modindex.html However, that only covers the CPython 3.6 standard ...
Read more >
Python Module Name Clashes (evanjones.ca)
Let's say we have a Python program called script.py , and two modules ... script.py", line 4, in <module> import mypackage.mymodule File "....
Read more >
Issue 34414: Absolute imports conflict with local files
This behaviour is not a bug, even if it can be confusing at times. Please read <https://docs.python.org/3/tutorial/modules.html>. History. Date ...
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