Skip to content

Conversation

@hoxbro
Copy link
Member

@hoxbro hoxbro commented Jun 24, 2024

This way, we can check in a notebook if the environment variable is set and give a warning if it is not.

image

Also available in the jupyter terminal.
image

import os

os.environ.get("_PYVIZ_COMMS_INSTALLED")

@hoxbro hoxbro marked this pull request as draft June 24, 2024 16:24
get_ipython = None

# Setting this so we can check the launched jupyter has pyviz_comms installed
if not (get_ipython and sys.argv[0].endswith('ipykernel_launcher.py')):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipykernel_launcher.py file is what launches a notebook.

I will update the comments if we decide to proceed with the PR.

The name of the environment variable can change maybe to PYVIZ_COMMS_INSTALLED.

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@hoxbro hoxbro marked this pull request as ready for review November 12, 2024 16:20
@hoxbro hoxbro merged commit 6301780 into main Nov 12, 2024
@hoxbro hoxbro deleted the add_env_variable branch November 12, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants