DEV Community

Ahmad Abdullah Tariq
Ahmad Abdullah Tariq

Posted on

Configure Jupyter Global Imports

  1. Open a terminal and go to the following directory

        cd ~/.ipython/profile_default/startup
    
  2. Now create a python file. You can name it anything you want:

        touch start.py
    
  3. Now open the file you can do inside the terminal or open up your favorite IDE.

        nano start.py
    

    Screenshot 2021-01-18 at 09.32.07

  4. Place all the libraries that you want to get imported by default.
    Screenshot 2021-01-18 at 09.29.23

  5. No press CMD+X and press Y to save.

  6. If you have jupyter instance running you need to restart them.

  7. To check if you successfully included those libraries you can check them in globals() in a notebook:
    Screenshot 2021-01-18 at 09.35.18

Ref: How to Automatically Import Your Favorite Libraries into IPython or a Jupyter Notebook

Top comments (0)