Issue
I am using Win 11
I installed wsl2 and ubuntu bash
i also installed spyder but everytime i try to run it i get error
asmgx@DELLG3:~$ spyder
/home/asmgx/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:122: PkgResourcesDeprecationWarning: 0.23ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/home/asmgx/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:122: PkgResourcesDeprecationWarning: 0.1.36ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
qt.qpa.xcb: could not connect to display :0.0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted
I googled and tried different solutioins proposed
such as
pip install spyder
pip install --upgrade spyder
pip install PyQt5
export QT_DEBUG_PLUGINS=1
but non worked
any one know how can i get spyder running?
Solution
spyder document Frequently Asked Questionsits explain how to connect.
If you already installed Spyder on your Windows machine, you do not need to reinstall it on a WSL2-based Linux environment if your code must run there.
Instead, just installMiniconda inside WSL2
and create a new conda environment (or use an existing conda- or virtualenv), then install Spyder-Kernels into that environment with e.g.conda install spyder-kernels
. You must manually install ipython_genutils with e.g. conda install ipython_genutils
To start a Spyder kernel, from your Linux terminal run
python -m spyder_kernels.console --matplotlib="inline" --ip=127.0.0.1 -f=~/remotemachine.json &
It will run the kernel as a subprocess and create a file named remotemachine.json in your WSL home folder.
Finally, under the options menu of Spyder’s IPython Console, select Connect to an existing kernel as described in Using external kernels. Insert the absolute path of remotemachine.json into the Connection file field. If you mapped W: as mentioned in above note, the path should be W:/home/username/remotemachine.json. A new console will open in Spyder, running in the Linux environment. Try running os.system('ls -la') and see if it lists your WSL home folder. If you run exit() from Spyder, the kernel running on Linux will be stopped.
You can fallow this url for any update.
At my end its work perfactly.
Answered By - GC Solution
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.