解决 Windows11 下 wsl 2使用 matplotlib.pyplot 画图没反应的问题
- 获取wls2主机地址 并 添加 .bashrc文件中 Dynamically export the DISPLAY environment variable in WSL2;
# add to ~/.bashrc, and source it.
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
2. 下载并打开 VcXsrv on Windows. It’s import to check the “Disable access contr
ol” to allow connection from WSL2;
3. pycharm中设置 Setting the DISPLAY environment variable in PyCharm;
评论
发表评论