title: Running cells with Python 3.10 requires ipykernel installed
body: <p>I just installed Python 3.10 on my laptop (Ubuntu 20.04).</p>
  <p>Running a Jupyter Notebook inside of VS Code works with Python 3.9 but not with Python 3.10. I get the error message: <code>Running cells with 'Python 3.10.0 64 bit' requires ipykernel installed or requires an update</code>.</p>
  <hr />
  <h4>Update February 2022</h4>
  <p>Jalil Nourmohammadi Khiarak gave a more complete answere, it is now the <a href="https://stackoverflow.com/a/71039682/11680331">new accepted answer</a>.</p>
  <hr />
  <h4>Update January 2022</h4>
  <p>It was a dumb error, I solved my problem (see <a href="https://stackoverflow.com/a/70811651/11680331">accepted answer</a>).</p>
  <hr />
  <p><strong>Things I tried:</strong></p>
  <ul>
  <li>Clicking on reinstall, which runs:</li>
  </ul>
  <pre><code>/usr/bin/python3.10 /home/joris/.vscode/extensions/ms-python.python-2021.10.1365161279/pythonFiles/shell_exec.py /usr/bin/python3.10 -m pip install -U --force-reinstall ipykernel /tmp/tmp-12568krFMIDJVy4jp.log
  </code></pre>
  <ul>
  <li>Running <code>pip3 install --upgrade ipykernel jupyter notebook pyzmq</code> (from <a href="https://stackoverflow.com/questions/64997553/python-requires-ipykernel-to-be-installed">this</a> thread).</li>
  </ul>
  <h4>Edits</h4>
  <ul>
  <li>As asked in the comments, here is the output when I click the &quot;reinstall&quot; button:</li>
  </ul>
  <pre class="lang-sh prettyprint-override"><code>/usr/bin/python3.10 /home/joris/.vscode/extensions/ms-python.python-2021.10.1365161279/pythonFiles/shell_exec.py /usr/bin/python3.10 -m pip install -U --force-reinstall ipykernel /tmp/tmp-10997AnLZP3B079oV.log
  Executing command in shell &gt;&gt; /usr/bin/python3.10 -m pip install -U --force-reinstall ipykernel
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.10/runpy.py&quot;, line 196, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File &quot;/usr/lib/python3.10/runpy.py&quot;, line 86, in _run_code
      exec(code, run_globals)
    File &quot;/usr/lib/python3/dist-packages/pip/__main__.py&quot;, line 19, in &lt;module&gt;
      sys.exit(_main())
    File &quot;/usr/lib/python3/dist-packages/pip/_internal/cli/main.py&quot;, line 73, in main
      command = create_command(cmd_name, isolated=(&quot;--isolated&quot; in cmd_args))
    File &quot;/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py&quot;, line 96, in create_command
      module = importlib.import_module(module_path)
    File &quot;/usr/lib/python3.10/importlib/__init__.py&quot;, line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1050, in _gcd_import
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1027, in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688, in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883, in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241, in _call_with_frames_removed
    File &quot;/usr/lib/python3/dist-packages/pip/_internal/commands/install.py&quot;, line 24, in &lt;module&gt;
      from pip._internal.cli.req_command import RequirementCommand
    File &quot;/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py&quot;, line 15, in &lt;module&gt;
      from pip._internal.index.package_finder import PackageFinder
    File &quot;/usr/lib/python3/dist-packages/pip/_internal/index/package_finder.py&quot;, line 21, in &lt;module&gt;
      from pip._internal.index.collector import parse_links
    File &quot;/usr/lib/python3/dist-packages/pip/_internal/index/collector.py&quot;, line 12, in &lt;module&gt;
      from pip._vendor import html5lib, requests
  ImportError: cannot import name 'html5lib' from 'pip._vendor' (/usr/lib/python3/dist-packages/pip/_vendor/__init__.py)
  Traceback (most recent call last):
    File &quot;/home/joris/.vscode/extensions/ms-python.python-2021.10.1365161279/pythonFiles/shell_exec.py&quot;, line 26, in &lt;module&gt;
      subprocess.check_call(shell_args, stdout=sys.stdout, stderr=sys.stderr)
    File &quot;/usr/lib/python3.10/subprocess.py&quot;, line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/usr/bin/python3.10', '-m', 'pip', 'install', '-U', '--force-reinstall', 'ipykernel']' returned non-zero exit status 1.
  </code></pre>
  <ul>
  <li>Here is what my <code>_vendor</code> folder contains:</li>
  </ul>
  <pre class="lang-sh prettyprint-override"><code>joris@joris-N751JK:~$ ls /usr/lib/python3/dist-packages/pip/_vendor/
  __init__.py  __pycache__
  </code></pre>
  <ul>
  <li>Here is the output of reinstalling pip and checking the <code>_vendor</code> file:</li>
  </ul>
  <pre class="lang-sh prettyprint-override"><code>joris@joris-N751JK:~$ python3 -m pip install --upgrade --force-reinstall pip
  Defaulting to user installation because normal site-packages is not writeable
  Collecting pip
    Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
  Installing collected packages: pip
    Attempting uninstall: pip
      Found existing installation: pip 21.3.1
      Uninstalling pip-21.3.1:
        Successfully uninstalled pip-21.3.1
  Successfully installed pip-21.3.1
  joris@joris-N751JK:~$ ls /usr/lib/python3/dist-packages/pip/_vendor
  __init__.py  __pycache__
  </code></pre>