[BUG] Databricks is not identified as Jupyter
See original GitHub issueYou may find a solution to your problem in the docs or issues.
Describe the bug
Databricks is not considered as โJupyterโ, therefore JUPYTER_LINES
and JUPYTER_COLUMNS
has no effect on the console log
Provide a minimal code example that demonstrates the issue if you can. If the issue is visual in nature, consider posting a screenshot.
Databricks has a Ipython type InteractiveShell
which is neither Ipython
or ZMQInteractiveShell
def _is_jupyter() -> bool: # pragma: no cover
"""Check if we're running in a Jupyter notebook."""
try:
get_ipython # type: ignore[name-defined]
except NameError:
return False
ipython = get_ipython() # type: ignore[name-defined]
shell = ipython.__class__.__name__
if "google.colab" in str(ipython.__class__) or shell == "ZMQInteractiveShell":
return True # Jupyter notebook or qtconsole
elif shell == "TerminalInteractiveShell":
return False # Terminal running IPython
else:
return False # Other type (?)
If youโre using Rich in a terminal:
python -m rich.diagnose
pip freeze | grep rich
If youโre using Rich in a Jupyter Notebook, run the following snippet in a cell and paste the output in your bug report.
from rich.diagnose import report
report()
โญโโโโโโโโโโโโโโโโโโโโโโ <class 'rich.console.Console'> โโโโโโโโโโโโโโโโโโโโโโโโฎ
โ A high level console interface. โ
โ โ
โ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ
โ โ <console width=80 None> โ โ
โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ โ
โ โ
โ color_system = None โ
โ encoding = 'utf-8' โ
โ file = <PythonShellImpl.ConsoleBuffer object at 0x7f462b809970> โ
โ height = 25 โ
โ is_alt_screen = False โ
โ is_dumb_terminal = False โ
โ is_interactive = False โ
โ is_jupyter = False โ
โ is_terminal = False โ
โ legacy_windows = False โ
โ no_color = False โ
โ options = ConsoleOptions( โ
โ size=ConsoleDimensions(width=80, height=25), โ
โ legacy_windows=False, โ
โ min_width=1, โ
โ max_width=80, โ
โ is_terminal=False, โ
โ encoding='utf-8', โ
โ max_height=25, โ
โ justify=None, โ
โ overflow=None, โ
โ no_wrap=False, โ
โ highlight=None, โ
โ markup=None, โ
โ height=None โ
โ ) โ
โ quiet = False โ
โ record = False โ
โ safe_box = True โ
โ size = ConsoleDimensions(width=80, height=25) โ
โ soft_wrap = False โ
โ stderr = False โ
โ style = None โ
โ tab_size = 8 โ
โ width = 80 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโ <class 'rich._windows.WindowsConsoleFeatures'> โโโโโฎ
โ Windows features available. โ
โ โ
โ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ
โ โ WindowsConsoleFeatures(vt=False, truecolor=False) โ โ
โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ โ
โ โ
โ truecolor = False โ
โ vt = False โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโ Environment Variables โโโโโโโโฎ
โ { โ
โ 'TERM': 'unknown', โ
โ 'COLORTERM': None, โ
โ 'CLICOLOR': None, โ
โ 'NO_COLOR': None, โ
โ 'TERM_PROGRAM': None, โ
โ 'COLUMNS': None, โ
โ 'LINES': None, โ
โ 'JUPYTER_COLUMNS': '200', โ
โ 'JUPYTER_LINES': '50', โ
โ 'JPY_PARENT_PID': None, โ
โ 'VSCODE_VERBOSE_LOGGING': None โ
โ } โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
platform="Linux"
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Value Labels fail to display in Databricks notebook but they ...
with this code, I can see the value labels in my Anaconda's Jupyter however, they are not displayed in my Databricks notebook? any...
Read more >Troubleshooting unresponsive Python notebooks or canceled ...
This article provides an overview of troubleshooting steps you can take if a notebook is unresponsive or cancels commands.
Read more >Databricks Connect | Databricks on AWS
Databricks Connect allows you to connect your favorite IDE (Eclipse, IntelliJ, PyCharm, RStudio, Visual Studio Code), notebook server (Jupyter Notebook,ย ...
Read more >Databricks Notebook Rendering Issue: IPython.lib.display ...
Expected Output โ Jupyter Notebook image ... -explainer-dashboard-output-in-databricks-notebook-is-not ... Fatal error: Python kernel is unresponsive.
Read more >Can you import a Jupyter notebook to a Databricks workspace?
Python job run error messages are unreadable ... Is there any limitation in querying the no. of SQL queries in Databricks SQL workspace....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There is no future proof way of detecting Jupyter that I know of. Iโd accept a PR for whatever fudge is required to detect Databricksโฆ
Iโll make a PR if this is ok, try to detect
DATABRICKS_ROOT_VIRTUALENV_ENV
.