Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway

We Are Going To Discuss About Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. So lets Start this Python Article.

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway

  1. How to solve Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway

    I reverted back to Xorg from wayland and its working, no more warnings
    Here are the steps:
    Disbled Wayland by uncommenting WaylandEnable=false in the /etc/gdm3/custom.conf
    Add QT_QPA_PLATFORM=xcb in /etc/environment
    Check whether you are on Wayland or Xorg using: echo $XDG_SESSION_TYPE

  2. Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway

    I reverted back to Xorg from wayland and its working, no more warnings
    Here are the steps:
    Disbled Wayland by uncommenting WaylandEnable=false in the /etc/gdm3/custom.conf
    Add QT_QPA_PLATFORM=xcb in /etc/environment
    Check whether you are on Wayland or Xorg using: echo $XDG_SESSION_TYPE

Solution 1

I reverted back to Xorg from wayland and its working, no more warnings

Here are the steps:

  1. Disbled Wayland by uncommenting WaylandEnable=false in the /etc/gdm3/custom.conf
  2. Add QT_QPA_PLATFORM=xcb in /etc/environment
  3. Check whether you are on Wayland or Xorg using:
    echo $XDG_SESSION_TYPE
    

Original Author Sita Ram Pothula Of This Content

Solution 2

The same Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway appears when drawing a plot with pandas and matplotlib on Wayland. If you don’t want to deactivate Wayland and go back to X11, you have the alternative to save the figure to a pdf file.

Create some data and a plot

import pandas
df = pandas.DataFrame({'x':range(0,30), 'y':range(10,40)})
df.set_index('x', inplace=True)
plot = df.plot(title='A nice line')

# Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

Save the figure to a pdf file as explained in this answer:

plot.get_figure().savefig('/tmp/output.pdf', format='pdf')

Or use jupyter lab to display the plot in your browser.

Original Author Paul Rougieux Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment