Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyder on Windows Subsystem for Linux - ImportError: libGL.so.1 #1246

Closed
pjacob2 opened this issue Oct 21, 2016 · 6 comments
Closed

Spyder on Windows Subsystem for Linux - ImportError: libGL.so.1 #1246

pjacob2 opened this issue Oct 21, 2016 · 6 comments

Comments

@pjacob2
Copy link

pjacob2 commented Oct 21, 2016

I am trying to start Spyder (part of Anaconda) on bash in Windows 10. Installing Anaconda with the Linux installation package provided on their website seems to work fine and python now is the Anaconda version which is as expected. When trying to launch the graphical python editor Spyder by typing spyder & I get the following error message however:

Traceback (most recent call last):
  File "/home/pmj27/anaconda2/bin/spyder", line 6, in <module>
    sys.exit(spyder.app.start.main())
  File "/home/pmj27/anaconda2/lib/python2.7/site-packages/spyder/app/start.py", line 103, in main
    from spyder.app import mainwindow
  File "/home/pmj27/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 78, in <module>
    from qtpy.compat import from_qvariant
  File "/home/pmj27/anaconda2/lib/python2.7/site-packages/qtpy/compat.py", line 15, in <module>
    from qtpy.QtWidgets import QFileDialog
  File "/home/pmj27/anaconda2/lib/python2.7/site-packages/qtpy/QtWidgets.py", line 21, in <module>
    from PyQt5.QtWidgets import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

I have read that WSL is not necessarily supporting GUIs so perhaps this command is not expected to work?

@fpqc
Copy link

fpqc commented Oct 21, 2016

Do you have vcXsrv installed and running? Did you export DISPLAY=:0?

@jamescaf
Copy link

jamescaf commented Jan 9, 2018

In case anyone else finds this like I did much later, here's what works for me with a similar error message:
I ran sudo apt-get install qtbase5-dev (see: https://forum.qiime2.org/t/qiime2-2017-5-installation-on-windows-subsystem-for-linux/694),
installed Xming on Windows (https://sourceforge.net/projects/xming/?source=typ_redirect), and added export DISPLAY=:0.0 to the end of .bashrc. This resolved the error and I can now run Spyder on WSL.

@therealkenc
Copy link
Collaborator

sudo apt install mesa-utils is a good pro-tip too. You can run glxgears to check that GL is working.

@pjjanas
Copy link

pjjanas commented Jul 19, 2022

In case anyone else finds this like I did much later, here's what works for me with a similar error message: I ran sudo apt-get install qtbase5-dev (see: https://forum.qiime2.org/t/qiime2-2017-5-installation-on-windows-subsystem-for-linux/694), installed Xming on Windows (https://sourceforge.net/projects/xming/?source=typ_redirect), and added export DISPLAY=:0.0 to the end of .bashrc. This resolved the error and I can now run Spyder on WSL.

running sudo apt-get install qtbase5-dev worked the charm for me. I am using Spyder on WSL with VcXsrv X Server for the GUI. Thank you!

@SteveWang1992
Copy link

sudo apt install mesa-utils is a good pro-tip too. You can run glxgears to check that GL is working.

This works for me. (On WSL2)
I met the issue after running the sypder official installation script below. And fixed the issue using the quoted method provided by therealkenc.
conda create -c conda-forge -n spyder-env spyder numpy scipy pandas matplotlib sympy cython

@bdabykov
Copy link

In case anyone else finds this like I did much later, here's what works for me with a similar error message: I ran sudo apt-get install qtbase5-dev (see: https://forum.qiime2.org/t/qiime2-2017-5-installation-on-windows-subsystem-for-linux/694), installed Xming on Windows (https://sourceforge.net/projects/xming/?source=typ_redirect), and added export DISPLAY=:0.0 to the end of .bashrc. This resolved the error and I can now run Spyder on WSL.

Running sudo apt-get install qtbase5-dev worked perfectly for me. I was trying to run NPYViewer in Linux subsystem for Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants