Wsl linux系统上安装python spyder

该文详细介绍了如何在Windows10的WSL2环境下,通过安装Ubuntu、Miniconda、Spyder,以及配置X11服务器VcXsrv,来在Linux子系统上成功运行SpyderIDE的过程。
摘要由CSDN通过智能技术生成

(一) 安装环境

Windows 10

已安装 WSL2 Ubuntu-22.04

(二)下载和安装Miniconda

1. 下载Miniconda:

打开Ubuntu

在Ubuntu中输入

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

2.安装Miniconda

在Ubuntu中输入

bash Miniconda3-latest-Linux-x86_64.sh

(三)安装spyder

在Ubuntu中输入

conda install spyder

以及安装如下的包,使得spyder能够运行

sudo apt-get install libxcursor-dev
sudo apt-get install alsa
sudo apt install libegl1-mesa libegl1

(四)下载和安装X11

X11是为了能够在Linux子系统上打开Spyder界面。

1.下载X11

X11下载网址

https://sourceforge.net/projects/vcxsrv/Download VcXsrv Windows X Server for free. Windows X-server based on the xorg git sources (like xming or cygwin's xwin), but compiled with Visual C++ 2012 Express Edition. Source code can also be compiled with VS2008, VS2008 Express Edition and VS2010 Express Edition, although current project and makefile are not fully compatible anymore.https://sourceforge.net/projects/vcxsrv/

2.安装配置X11

按默认选项安装X11

配置时,在“Display number”中输入0

 按以下默认的选项,点"Next"

 按以下选上“Disaable access control”,点“Next”

 点“Save configuration”, 点“Finish”

我就把X11的配置文件放在文档啦~~~~~~

 

 以下Private networks 和Public networks都要选上!

 在安装完VcXscrv Windows X Server,在Ubuntu终端输入

nano ~/.bashrc

然后,在这一段最后贴入

DISPLAY=:0
export DISPLAY
LIBGL_ALWAYS_INDIRECT=1
Export LIBGL_ALWAYS_INDIRECT

如图

 然后Ctrl X退出,再选yes,再输入enter。然后关闭Ubuntu,不然不会成功哦。

(五)在WSL Ubuntu中打开Spyder

1.先打开X11

2.就可以在Ubuntu中打开Spyder啦

(六)参考资料:

https://sqmao.medium.com/using-wsl2-to-set-up-a-spyder-ide-on-windows-10-3734139b554https://sqmao.medium.com/using-wsl2-to-set-up-a-spyder-ide-on-windows-10-3734139b554https://medium.com/@macasaetjohn/setting-up-a-spyder-environment-with-wsl-bb83716a44f3https://medium.com/@macasaetjohn/setting-up-a-spyder-environment-with-wsl-bb83716a44f3

---------------------------------------------------------------------------------------------------------------------------------

希望可以帮助到你哦,有问题敬请联系本人1131062932@qq.com,一起交流!!!!

---------------------------------------------------------------------------------------------------------------------------------
 

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值