2

I have a jupyter/conda setup with multiple users. I was previously working with a single user and defined some .py files in the ~.ipython/profile_default/startup folder. But that startup folder is unique to the profile/user. Is there a way for me to execute the files in the startup folder regardless of which user/profile is being used whenever a new Notebook is launched?

In simpler terms, is it possible to create a profile_default at Jupyter level instead of individual user level?

Thank you!

1 Answer 1

1

One possible solution would be to set the IPYTHONDIR environment variable for all users to point to a single location, such as:

export IPYTHONDIR=/path/to/.ipython

And then place files under /path/to/.ipython/profile_default/startup

Definition:

IPYTHONDIR: If set, this environment variable should be the path to a directory, which IPython will use for user data. IPython will create it if it does not exist.

Source: https://ipython.org/ipython-doc/3/config/intro.html#the-ipython-directory

There is a big gotcha, however; this directory must be writeable by each user that uses it. This is usually not an issue for ~/.ipython for each user, but you should be mindful of this requirement if using a place such as /usr/local or /etc.


Another solution would be to use the systemwide configuration paths, namely

/etc/ipython/
/usr/local/etc/ipython/
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.