[Python] VS Code: Can't run Python Interactive Window

Discussão em 'Python' iniciado por Stack, Fevereiro 6, 2025.

  1. Stack

    Stack Membro Participativo

    When I try running a Python Interactive Window in VS Code i get the error message:

    Jupyter notebook failed to launch.
    Error: Traceback (most recent call last):
    File "C:\Users\Parker\AppData\Local\Programs\Python\Python37\lib\site-packages\nbformat\validator.py", line 12, in <module>
    from jsonschema import ValidationError
    File "C:\Users\Parker\AppData\Roaming\Python\Python37\site-packages\jsonschema\__init__.py", line 11, in <module>
    from jsonschema.exceptions import (
    File "C:\Users\Parker\AppData\Roaming\Python\Python37\site-packages\jsonschema\exceptions.py", line 9, in <module>
    import attr
    ModuleNotFoundError: No module named 'attr'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "c:\Users\Parker\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\vscode_datascience_helpers\daemon\daemon_python.py", line 54, in _decorator
    return func(self, *args, **kwargs)
    File "c:\Users\Parker\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\vscode_datascience_helpers\jupyter_daemon.py", line 105, in m_exec_module_observable
    self._start_notebook(args, cwd, env)
    File "c:\Users\Parker\.vscode\extensions\ms-python.python-2020.5.80290\pythonFiles\vscode_datascience_helpers\jupyter_daemon.py", line 147, in _start_notebook
    from notebook import notebookapp as app
    File "C:\Users\Parker\AppData\Local\Programs\Python\Python37\lib\site-packages\notebook\notebookapp.py", line 83, in <module>
    from .services.contents.manager import ContentsManager
    File "C:\Users\Parker\AppData\Local\Programs\Python\Python37\lib\site-packages\notebook\services\contents\manager.py", line 17, in <module>
    from nbformat import sign, validate as validate_nb, ValidationError
    File "C:\Users\Parker\AppData\Local\Programs\Python\Python37\lib\site-packages\nbformat\__init__.py", line 33, in <module>
    from .validator import validate, ValidationError
    File "C:\Users\Parker\AppData\Local\Programs\Python\Python37\lib\site-packages\nbformat\validator.py", line 23, in <module>
    raise ImportError(str(e) + verbose_msg)
    ImportError: No module named 'attr'

    Jupyter notebook format depends on the jsonschema package:

    https://pypi.python.org/pypi/jsonschema

    Please install it first.


    Failed to run jupyter as observable with args notebook --no-browser --notebook-dir=C:\Users\Parker\AppData\Local\Temp\e74520b3-6a8d-4e0a-8f80-8ddf2a64bf70 --config=C:\Users\Parker\AppData\Local\Temp\e74520b3-6a8d-4e0a-8f80-8ddf2a64bf70\jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0


    There was another thread about this same problem here: Can't use Jupyter Notebook: jsonschema apparently missing, however, after following all the steps in the solution the error persist. If anyone might be able to provide a possible solution, I'd greatly appreciate it.

    Continue reading...

Compartilhe esta Página