Turtle does not run more than once in jupyter notebook

This is apparently a recurrent problem with Jupyter/iPython

You can install iPyTurtle that's should help a lot.
Found on this medium article

You can also create a file containing your commands using %%file turtle_example.py in top of cell and in cell below, then run it using !python turtle_example.py.
But this is not really great


I was having this problem too! Try:

$ pip install ipyturtle

$ jupyter nbextension enable --py --sys-prefix ipyturtle


In the setup.py file, in lines 74 & 75, change

os.path.join(here, 'ipyturtle', 'static', 'extension.js'),

os.path.join(here, 'ipyturtle', 'static', 'index.js')

to

os.path.join(here, 'js', 'lib', 'extension.js'),

os.path.join(here, 'js', 'lib', 'index.js')


$ pip install -e .

$ jupyter nbextension install --py --symlink --sys-prefix ipyturtle

$ jupyter nbextension enable --py --sys-prefix ipyturtle


Should say 'Successfully installed ipyturtle' at the end