Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive mode doesnt launch when file named xml.py exists. #10676

Closed
cemde opened this issue Jul 2, 2022 · 2 comments
Closed

Interactive mode doesnt launch when file named xml.py exists. #10676

cemde opened this issue Jul 2, 2022 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@cemde
Copy link

cemde commented Jul 2, 2022

Issue Type: Bug

TL,DR: a file called xml.py blocks the start of interactive python.

I have a folder with two files in: file1.py and xml.py. Both have this content

# %%
import numpy as np
print(np.zeros((3,3)))
# %%

when I start to run the this cell interactively in either file, I get this error message

The kernel failed to start due to the missing module 'xml.dom'. Consider installing this module.
Click here for more info.

with this traceback in the logs

stdErr: 'Traceback (most recent call last):\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/runpy.py", line 196, in _run_module_as_main\n' +
    '    return _run_code(code, main_globals, None,\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/runpy.py", line 86, in _run_code\n' +
    '    exec(code, run_globals)\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/ipykernel_launcher.py", line 15, in <module>\n' +
    '    from ipykernel import kernelapp as app\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 18, in <module>\n' +
    '    from IPython.core.application import (\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/IPython/__init__.py", line 53, in <module>\n' +
    '    from .terminal.embed import embed\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/IPython/terminal/embed.py", line 16, in <module>\n' +
    '    from IPython.terminal.interactiveshell import TerminalInteractiveShell\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 29, in <module>\n' +
    '    from prompt_toolkit.auto_suggest import AutoSuggestFromHistory\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/prompt_toolkit/__init__.py", line 16, in <module>\n' +
    '    from .application import Application\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/prompt_toolkit/application/__init__.py", line 1, in <module>\n' +
    '    from .application import Application\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/prompt_toolkit/application/application.py", line 42, in <module>\n' +
    '    from prompt_toolkit.buffer import Buffer\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/prompt_toolkit/buffer.py", line 37, in <module>\n' +
    '    from .completion import (\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/prompt_toolkit/completion/__init__.py", line 1, in <module>\n' +
    '    from .base import (\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/prompt_toolkit/completion/base.py", line 9, in <module>\n' +
    '    from prompt_toolkit.formatted_text import AnyFormattedText, StyleAndTextTuples\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/prompt_toolkit/formatted_text/__init__.py", line 23, in <module>\n' +
    '    from .html import HTML\n' +
    '  File "/Users/cornelius/opt/anaconda3/envs/general/lib/python3.10/site-packages/prompt_toolkit/formatted_text/html.py", line 1, in <module>\n' +
    '    import xml.dom.minidom as minidom\n' +
    "ModuleNotFoundError: No module named 'xml.dom'; 'xml' is not a package\n"
}
info 12:40:38.212: Process Execution: > ~/opt/anaconda3/envs/general/bin/python -c "import ipykernel"
> ~/opt/anaconda3/envs/general/bin/python -c "import ipykernel"

If I rename xml.py to something else, e.g. learnxmlparsing.py everything works fine.

VS Code version: Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:52:13.188Z)
OS version: Darwin x64 21.5.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2900)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 5, 5, 5
Memory (System) 16.00GB (0.39GB free)
Process Argv --crash-reporter-id 6397a4b7-75cd-4f19-8dc9-765ceb42a9a5
Screen Reader no
VM 0%
Extensions (27)
Extension Author (truncated) Version
project-manager ale 12.6.0
docs-markdown doc 0.2.113
gitlens eam 12.1.1
prettier-vscode esb 9.5.0
copilot Git 1.31.6194
mdmath goe 2.7.4
todo-tree Gru 0.0.215
vsc-python-indent Kev 1.17.0
restructuredtext lex 189.0.0
rainbow-csv mec 2.4.0
git-graph mhu 1.30.0
vscode-duplicate mrm 1.2.1
vscode-docker ms- 1.22.0
python ms- 2022.8.1
vscode-pylance ms- 2022.6.30
jupyter ms- 2022.5.1001601848
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.8
remote-containers ms- 0.238.3
remote-ssh ms- 0.82.1
remote-ssh-edit ms- 0.80.0
remote-wsl ms- 0.66.3
vscode-remote-extensionpack ms- 0.21.0
makefile-tools ms- 0.5.0
autodocstring njp 0.6.1
csv-to-table php 1.4.0
simple-rst tro 1.5.2
@cemde cemde added the bug Issue identified by VS Code Team member as probable bug label Jul 2, 2022
@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Jul 2, 2022
@amunger
Copy link
Contributor

amunger commented Jul 5, 2022

This sounds like a built-in module being overridden, which means you just wouldn't be able to have a file with that name, but it looks like those are typically caused by importFailoures, wheras moduleNotFoundFailures have much less clear error messages.

@greazer greazer added kernel-management and removed triage-needed Issue needs to be triaged labels Jul 7, 2022
@greazer greazer added this to the July 2022 milestone Jul 7, 2022
@amunger
Copy link
Contributor

amunger commented Jul 27, 2022

seems to be fixed as part of #7538. Improved error message

@amunger amunger closed this as completed Jul 27, 2022
@amunger amunger added the verified Verification succeeded label Jul 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants