Azure / Azure/azure-cli-extensions
azure-cli-interactive 0.3.31 has requirement prompt-toolkit~=1.0.15 causes Jupyter kernel crash
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
**Describe the bug**
azure-cli-interactive 0.3.31 has requirement prompt-toolkit~=1.0.15 which causes Jupyter kernels to fail. The latter requires prompt-toolkit~=2.0.6.
**To Reproduce**
Using this YAML:
```
name: fubar
channels:
- conda-forge
dependencies:
- python=3.5
- nb_conda==2.2.0
- pip:
- azure-cli
```
create a conda environment:
```
conda env create -f fubar.yml
```
Activate this environment, and start a Jupyter notebook server:
```
source activate fubar
jupyter notebook
```
In the Home window, open a Python notebook using the fubar kernel. Then observe kernel failure reports back at the command line:
```
...
[I 16:28:24.776 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
File "/anaconda/envs/fubar/lib/python3.5/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/anaconda/envs/fubar/lib/python3.5/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/anaconda/envs/fubar/lib/python3.5/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/anaconda/envs/fubar/lib/python3.5/site-packages/ipykernel/__init__.py", line 2, in
from .connect import *
File "/anaconda/envs/fubar/lib/python3.5/site-packages/ipykernel/connect.py", line 13, in
from IPython.core.profiledir import ProfileDir
File "/anaconda/envs/fubar/lib/python3.5/site-packages/IPython/__init__.py", line 55, in
from .terminal.embed import embed
File "/anaconda/envs/fubar/lib/python3.5/site-packages/IPython/terminal/embed.py", line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/anaconda/envs/fubar/lib/python3.5/site-packages/IPython/terminal/interactiveshell.py", line 20, in
from prompt_toolkit.formatted_text import PygmentsTokens
ImportError: No module named 'prompt_toolkit.formatted_text'
[W 16:28:27.785 NotebookApp] KernelRestarter: restart failed
[W 16:28:27.785 NotebookApp] Kernel e17c2ef8-2d57-48f3-a5cb-615ef23fefac died, removing from map.
```
**Expected behavior**
I expected the kernel to start without failure.
**Environment summary**
The Azure CLI is installed with the conda environment. This is wrong from CLI versions 2.0.41 and later. This was done on a Ubuntu DSVM created on 10-30-2018.
**Additional context**
One workaround is to use this environment YML:
```
name: winner
channels:
- conda-forge
dependencies:
- python=3.5
- nb_conda==2.2.0
- pip:
- azure-cli
- prompt_toolkit>2
```
Contributor guide
Assessment
This issue has not been assessed yet.