0

I'm trying to run the following few lines with ipython (3.5 version):

import sys
from init_mooc_nb import *
init_notebook()

I would like some help to figure out what is the error (see below).

Thank you in advance.

Complete Error

T.O.Puel
  • 5
  • 1
  • 3
  • 1
    try running this via `ipython`, i.e: `ipython script_name.py` and see if the error exists. – Dimitris Fasarakis Hilliard Aug 26 '16 at 18:29
  • What did you name your file? – user2357112 Aug 26 '16 at 18:30
  • Thank you Jim and user2357112. In the description above, I did exactly as Jim said. I put the code lines in a file named _test.py_ and run with `ipython test.py`. I realised that those lines work in a Jupyter notebook. Then I have created a notebook file _test.ipynb_ and run through Jupyter environment (browser front-end). Now it is working good :) I still don't know how to run this file _test.ipynb_ from terminal. Is that possible? – T.O.Puel Aug 27 '16 at 22:59
  • http://stackoverflow.com/questions/35545402/running-ipynb-from-terminal – iparjono Aug 29 '16 at 16:15
  • Thank you, iparjono – T.O.Puel Aug 30 '16 at 19:23

2 Answers2

0

It is possible that this is part of an ipython notebook and needs to be run in ipython notebook... (use e.g. jupyter notebookor ipython -notebook from command line to start it...)

ntg
  • 12,950
  • 7
  • 74
  • 95
0

If you're using Intellij Idea with the Python plugin: Put your notebooks inside a python package and then right click the package and select Mark directory as -> Load Path Root

There's an open bug on the Intellij idea team here

RoyalBigMack
  • 620
  • 7
  • 7
  • 1
    Thanks Royal, the issue was solved with the previous comments. But this might be useful to someone else. Thanks for sharing. – T.O.Puel Mar 13 '23 at 15:31