no display name and no $DISPLAY environment variable in Jupyter Notebook

微笑、不失礼 提交于 2020-02-05 12:56:10

问题


I want to teach Python for kids. I want them to use Jupyter Notebook. To avoid the hassle of installation, I want them to use a free online Jupyter Notebook. I thought google's colab (link) and jupyter.org (link) could be best solutions. However, I tried them both and got the error message below:

from turtle import *
colors = ['red', 'purple', 'blue', 'green', 'yellow', 'orange']
for x in range(360):
  pencolor(colors[x % 6])
  width(x / 100 + 1)
  forward(x)
  left(59)

TclError: no display name and no $DISPLAY environment variable


回答1:


Did you look at this issue:

ipython notebook - $DISPLAY variable error

Your problem might be solved if you run before:

%matplotlib inline


来源:https://stackoverflow.com/questions/56694317/no-display-name-and-no-display-environment-variable-in-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!