question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatic Jupyter environment detection

See original GitHub issue

Something similar to tqdm’s auto module would be helpful. This would mean I can run the same code in Jupyter or a terminal and get the same rich experience.

Basically, it would just be a small wrapper that does a simple check to whether or not we are in an IPython environment or a regular Python one, and then import the console and print objects from the correct package. Then you could write code like this, knowing it would work wherever it was run:

from rich.auto import print

print("[bold magenta]Hello, world![\]")

Alternatively you could put this functionality into the default imports; I’m not sure why you would ever not want this (other than to avoid the overhead of checking, but that’s fairly minimal).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:10

github_iconTop GitHub Comments

5reactions
willmcgugancommented, May 28, 2020

For those interested, I have a ‘jupyter’ branch with improved Jupyter support.

It’s completely transparent now. The same imports and API will work in the terminal and notebook. Here is a screenshot:

Screen Shot 2020-05-28 at 17 46 32
5reactions
willmcgugancommented, May 5, 2020

Yeah, I think I could do something along those lines.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic Environment Kernel Detection for Jupyter - GitHub
A Jupyter plugin to enable the automatic detection of environments as kernels. This plugin looks in the directories you specify for installed environments...
Read more >
Get Your Conda Environment to Show in Jupyter Notebooks
To get your other environment kernels to show automatically: 1. First, install nb_conda_kernels in your base environment. Once this is installed ...
Read more >
Automatic Environment Kernel Detection For Jupyter - Morioh
A Jupyter plugin to enable the automatic detection of environments as kernels. This plugin looks in the directories you specify for installed environments...
Read more >
How to Automate a Jupyter Notebook? | Analytics Vidhya
Anyone looking to run a Jupyter Notebook automatically within your PC, I have a solution in 5 simple steps! Pipeline: CronTab ->Bash Script...
Read more >
How to enable auto-completion in Jupyter Notebook
You have auto-complete in Jupyter notebooks like you have in any other Jupyter environment. Simply hit the “Tab” key while writing code.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found