简体   繁体   English

linux for fenics 程序的 windows 子系统上的 python3 错误

[英]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.

相关问题 在 Windows 子系统中运行 FEniCS 时添加无效语法错误 - Invalid Syntax error on addition when running FEniCS in Windows subsystem 如何在 Linux 的 Windows 子系统中安装 Python 模块? - How to install Python modules in Windows subsystem for Linux? 让 PyC​​harm 在 windows linux 子系统上识别 python(windows 上的 bash) - Getting PyCharm to recognize python on the windows linux subsystem (bash on windows) windows ubuntu 子系统上的 Python 语法错误 - Python syntax error on windows ubuntu subsystem 为什么tkinter X程序通过SSH与MobaXterm一起工作,但在通过Windows子系统Linux使用SSH时出错? - Why does tkinter X program work through SSH with MobaXterm, but give an error when using SSH through Windows Subsystem for Linux? Visual Studio代码,使用WSL进行Python linting(适用于Linux的Windows子系统) - Visual Studio Code, Python linting with WSL (Windows Subsystem for Linux) Crontab 未在 Windows Subsystem for Linux (WSL) 上运行 python 脚本 - Crontab not running python script on Windows Subsystem for Linux (WSL) Windows 10 Linux子系统 - Python - 字符串到计算机剪贴板 - Windows 10 Linux subsystem - Python - String to computer clipboard Python 无法在适用于 Linux 的 Windows 子系统中找到文件 - Python can't find file in Windows Subsystem for Linux 将 Jupyter 与适用于 Linux 的 Windows 子系统结合使用 - Using Jupyter with Windows Subsystem for Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM