-1

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

What's the problem here ?

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

Community
  • 1
  • 1
S. Maths
  • 99
  • 3

1 Answers1

0

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

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.

BernardL
  • 5,162
  • 7
  • 28
  • 47
  • 1
    I don't think you can simply share the Windows GUI as an X11 `DISPLAY`. Quick googling gets me https://virtualizationreview.com/articles/2017/02/08/graphical-programs-on-windows-subsystem-on-linux.aspx?m=1 – tripleee Oct 20 '18 at 13:42
  • I simply try to open the file on the terminal ans get this error, other files are opened with no problem. – S. Maths Oct 20 '18 at 14:10