[英]Error on python3 on windows subsystem for linux for fenics program
I'm just starting to use fenics in python3 on windows subsystem ubuntu, and when I open the first titurial file I got this error.我刚开始在 Windows 子系统 ubuntu 上的 python3 中使用 fenics,当我打开第一个 tiurial 文件时,我收到了这个错误。
Solving linear variational problem. Traceback (most recent call last):
File "ft01_poisson.py", line 39, in <module> plot(u) File "/usr/lib
/python3/dist-packages/dolfin/common/plotting.py", line 438, in plot
return _plot_matplotlib(object, mesh, kwargs) File "/usr/lib/python3/dist-packages/dolfin/common/plotting.py", line 281, in _plot_matplotlib
ax = plt.gca() File "/usr/lib/python3/dist-packages/matplotlib
/pyplot.py", line 962, in gca return gcf().gca(**kwargs) File "/usr/lib
/python3/dist-packages/matplotlib/pyplot.py", line 592, in gcf return
figure() File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line
539, in figure **kwargs) File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 171, in new_figure_manager return cls.new_figure_manager_given_figure(num, fig) File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 1049, in new_figure_manager_given_figure window = Tk.Tk(className="matplotlib") File "/usr/lib/python3.6/tkinter/__init__.py", line 2020, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment variable
What's the problem here ?这里有什么问题?
I also have some problems to open windows files on ubunto terminal easily.我在 ubunto 终端上轻松打开 windows 文件也有一些问题。 Is there any simple method to do this ?有什么简单的方法可以做到这一点吗?
Have you taken a look at the debug error?您是否查看了调试错误? The error occurs in file: ft01_poisson.py
, also with the error message: TclError: no display name and no $DISPLAY environment variable
错误发生在文件: ft01_poisson.py
,还有错误消息: TclError: no display name and no $DISPLAY environment variable
It would seem you are calling another python script and you need to start debugging from there and not just the error message.看起来您正在调用另一个 python 脚本,您需要从那里开始调试,而不仅仅是错误消息。 The error message also suggests that you need to have the $DISPLAY environmental variable set.该错误消息还表明您需要设置 $DISPLAY 环境变量。 You can use the Python library: https://docs.python.org/3/library/os.html#os.environ to view your environmental variables.您可以使用 Python 库: https : //docs.python.org/3/library/os.html#os.environ查看您的环境变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.