Install the base component of Matplotlib when using the Windows Subsystem for Linux

My Matplotlib database keeps coming back to TkAgg. This is a problem because in the Windows subsystem for Linux (WSL) you cannot work with the GUI and therefore I get an error

TclError: no display name and no $ DISPLAY environment variable

I tried adding the file matplotlibrcto /home/<user>/.config/matplotlib(in the Windows file system this C:\Users\<user>\AppData\Local\lxss\home\<user>\.config\matplotlib).

My matplotlibrclooks like this

backend : Agg

However, if I do this

$ cd /home/<user>/.config/matplotlib
$ ls -A

nothing is displayed.

When i try

 $ python
 >>> import matplotlib
 >>> matplotlib.get_backend()
 'TkAgg'

therefore it does not set the backend to Agg. Why not?

Update:

, backend : Agg C:\Users\<user>\AppData\Local\lxss\home\<user>\.config\matplotlib\matplotlibrc Windows Python, Linux Python TkAgg. , Windows Python C:\Users\<user>\AppData\Local\Enthought\Canopy\User\Lib\site-packages\matplotlib\mpl-data\matplotlibrc, ?

+4
1

. matplotlibrc Windows - , $ ls -A bash. ( Windows ):

$ cd /home/<user>/.config/matplotlib
$ touch matplotlibrc
$ echo "backend : Agg" > matplotlibrc

(touch matplotlibrc matplotlibrc)

, ppton Windows ppton Qt4Agg.


/:

cd /home/<user>/.config/matplotlib; touch matplotlibrc && echo "backend : Agg" > matplotlibrc
+3

Source: https://habr.com/ru/post/1661611/


All Articles