ipykernel: 6.0.0: `python -m ipykernel install` fails on missing `debugpy`

Issue is that there are some issues with debugpy like https://github.com/microsoft/debugpy/issues/652 https://github.com/microsoft/debugpy/issues/595

+ /usr/bin/install build/sphinx/man/python-ipykernel.3 -Dt /home/tkloczko/rpmbuild/BUILDROOT/python-ipykernel-6.0.0-2.fc35.x86_64/usr/share/man/man3
+ /usr/bin/python3 -m ipykernel install --prefix /home/tkloczko/rpmbuild/BUILDROOT/python-ipykernel-6.0.0-2.fc35.x86_64/usr
Traceback (most recent call last):
  File "/usr/lib64/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0/ipykernel/__main__.py", line 2, in <module>
    from ipykernel import kernelapp as app
  File "/home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0/ipykernel/kernelapp.py", line 42, in <module>
    from .ipkernel import IPythonKernel
  File "/home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0/ipykernel/ipkernel.py", line 20, in <module>
    from .debugger import Debugger
  File "/home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0/ipykernel/debugger.py", line 14, in <module>
    import debugpy
ModuleNotFoundError: No module named 'debugpy'

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

OK maybe it is not obvious but I’m only poinyting on simple fact that new version ipykernel module started using other module which has some serious issues. Issue on which I’ve pointed has nothing to do with ipykernel testing or my build env but with fact that debugpy code uses python 2.x syntax and that module is now used by new ipykernel version.

Well using new dependencies is our rights, we are the developers of the libraries, and we now have dependencies on debugpy, importlib-metadata<4 for python version lower than 3.8 and matplotlib-inline. These new dependencies are one of the reasons we bumped the version number to 6.0.0, it is a major incompatible new version.

Debugpy work on 3.8

$ python
Python 3.8.5 | packaged by conda-forge | (default, Sep 16 2020, 17:43:11)
[Clang 10.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import debugpy

You seem to be the only one that find debugpy has some “serious issues”, from what I can tell this is because you are trying to byte-compile ahead of time files that you should not. Then, exclude those files.

If you want to request that we make debugpy an optional dependency, please open another issue. As far what it requested in this bug report, this is a non-issue and work as expected.

I agree with @bnavigator that @kloczek has some issues when installing debugpy in their build env and that has nothing to do with an ipykernel bug (hence this issue should be closed).

@kloczek, as you can see here, for instance, ipykernel is being tested on Python 3.7 to 3.9 without problems.

Still debugpy is required on pytest execution.

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILD/sphinxcontrib-towncrier-0.2.0a0/build/lib
+ PYTHONDONTWRITEBYTECODE=1
+ /usr/bin/pytest -ra --ignore ipykernel/debugger.py --ignore ipykernel/ipkernel.py --ignore ipykernel/kernelapp.py
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, Faker-8.9.0
collected 92 items / 3 errors / 89 selected

================================================================================== ERRORS ==================================================================================
________________________________________________________ ERROR collecting ipykernel/inprocess/tests/test_kernel.py _________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0/ipykernel/inprocess/tests/test_kernel.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ipykernel/inprocess/tests/test_kernel.py:14: in <module>
    from ipykernel.inprocess.ipkernel import InProcessKernel
ipykernel/inprocess/ipkernel.py:13: in <module>
    from ipykernel.ipkernel import IPythonKernel
ipykernel/ipkernel.py:20: in <module>
    from .debugger import Debugger
ipykernel/debugger.py:14: in <module>
    import debugpy
E   ModuleNotFoundError: No module named 'debugpy'
_____________________________________________________________ ERROR collecting ipykernel/tests/test_connect.py _____________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0/ipykernel/tests/test_connect.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ipykernel/tests/test_connect.py:18: in <module>
    from ipykernel.kernelapp import IPKernelApp
ipykernel/kernelapp.py:42: in <module>
    from .ipkernel import IPythonKernel
ipykernel/ipkernel.py:20: in <module>
    from .debugger import Debugger
ipykernel/debugger.py:14: in <module>
    import debugpy
E   ModuleNotFoundError: No module named 'debugpy'
___________________________________________________________ ERROR collecting ipykernel/tests/test_pickleutil.py ____________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0/ipykernel/tests/test_pickleutil.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ipykernel/tests/test_pickleutil.py:4: in <module>
    from ipykernel.pickleutil import can, uncan, codeutil
ipykernel/pickleutil.py:21: in <module>
    from ipyparallel.serialize import codeutil
E   ModuleNotFoundError: No module named 'ipyparallel'
============================================================================= warnings summary =============================================================================
ipykernel/tests/test_pickleutil.py:4
  /home/tkloczko/rpmbuild/BUILD/ipykernel-6.0.0/ipykernel/tests/test_pickleutil.py:4: DeprecationWarning: ipykernel.pickleutil is deprecated. It has moved to ipyparallel.
    from ipykernel.pickleutil import can, uncan, codeutil

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
ERROR ipykernel/inprocess/tests/test_kernel.py
ERROR ipykernel/tests/test_connect.py
ERROR ipykernel/tests/test_pickleutil.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 1 warning, 3 errors in 1.04s =======================================================================

BTW … please have look on that DeprecationWarning.