linux for fenics 程序的 windows 子系统上的 python3 错误 [英] Error on python3 on windows subsystem for linux for fenics program

查看:41
本文介绍了linux for fenics 程序的 windows 子系统上的 python3 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始在 windows 子系统 ubuntu 上的 python3 中使用 fenics,当我打开第一个示例 文件我收到了这个错误.

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.

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

这里有什么问题?

我也有一些问题,无法在 ubunto 终端上轻松打开 Windows 文件.有什么简单的方法可以做到这一点吗?

I also have some problems to open windows files on ubunto terminal easily. Is there any simple method to do this ?

推荐答案

你有没有看一下调试错误?错误发生在文件:ft01_poisson.py,还有错误信息:TclError: no display name and no $DISPLAY environment variable

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

看起来您正在调用另一个 python 脚本,您需要从那里开始调试,而不仅仅是错误消息.该错误消息还表明您需要设置 $DISPLAY 环境变量.您可以使用 Python 库:https://docs.python.org/3/library/os.html#os.environ 查看您的环境变量.

It would seem you are calling another python script and you need to start debugging from there and not just the error message. The error message also suggests that you need to have the $DISPLAY environmental variable set. You can use the Python library: https://docs.python.org/3/library/os.html#os.environ to view your environmental variables.

这篇关于linux for fenics 程序的 windows 子系统上的 python3 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆