# How to set iPython startup script for all users

**URL:** <https://discourse.jupyter.org/t/how-to-set-ipython-startup-script-for-all-users/17556>\
**Category:** The Littlest JupyterHub\
**Created:** [January 16, 2023, 9:46am UTC](https://discourse.jupyter.org/t/how-to-set-ipython-startup-script-for-all-users/17556 "2023-01-16T09:46:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TidbitSoftware](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/tidbitsoftware/32/8896_2.png) [@TidbitSoftware](https://discourse.jupyter.org/u/TidbitSoftware)\
**Post date:** [January 16, 2023, 9:46am UTC](https://discourse.jupyter.org/t/how-to-set-ipython-startup-script-for-all-users/17556/1 "2023-01-16T09:46:49Z")

</div>

We have a set of precompiled modules that we would normally (as in, Python on a local machine) advise users to load with a startup script pointed to by `PYTHONSTARTUP` in their shell profile. We would like to do something similar under TLJH, but as far as I can tell, `/etc/bash.bashrc` and `~/.bashrc` are not modifying the environment into which the iPython instances are launched. I understand that we can modify the environment for the application launchers with `/opt/tljh/config/jupyterhub_config.d/environment.py`, and that startup scripts can be added to `~/.ipython/profile_default/startup` for individual users, but we would like to have a startup script run for all users without having to copy it to each user’s home. Is there a recommended way to go about this? Thanks!

---

<div class="post-metadata">

**Author:** ![TidbitSoftware](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/tidbitsoftware/32/8896_2.png) [@TidbitSoftware](https://discourse.jupyter.org/u/TidbitSoftware)\
**Post date:** [January 16, 2023, 7:20pm UTC](https://discourse.jupyter.org/t/how-to-set-ipython-startup-script-for-all-users/17556/2 "2023-01-16T19:20:24Z")

</div>

After experimenting some more (added `PYTHONSTARTUP` to `c.Spawner.environment`) it appears that the process started by the ‘Python 3 (ipykernel)’ launcher does not run the script pointed to by `PYTHONSTARTUP` as expected anyhow.
