[pycharm remote python console]: quot;cannot connect to X serverquot; error with import pandas(【pycharm远程python控制台】:“无法连接X服务器导入 pandas 错误)
问题描述
我为 PyCharm 配置了一个远程 python 解释器并连接了 SSH 凭据.整个设置工作正常,除非我尝试导入任何使用 Qt 的 python 库,例如 pandas 或 matplotlib.
I configured a remote python interpreter for PyCharm and connected with SSH credentials. The whole setup works fine, except when I try to import any python library which uses Qt, such as pandas or matplotlib.
我放了一个带有此错误的远程 python 控制台的屏幕截图.当我单独 ssh 进入远程系统时,相同的导入命令可以正常工作.
I put a screenshot of the remote python console with this error. When I separately ssh into the remote system the same import commands work fine.
我在远程服务器上使用 Anaconda 来安装所有 python 库.我检查了pyqt也安装了.
I am using Anaconda on the remote server to install all python libraries. I checked the pyqt is installed too.
谁能帮我解决这个问题?
Can anyone help me figure this out?
推荐答案
有效的是,我在远程系统中安装了一个 GUI.然后安装 vnc 并通过运行 vncserver 对其进行配置.它给出了一个显示编号,比如 5.0.然后我把 PyCharm 中的环境变量放到项目设置中的 DISPLAY=:5.0 中.那行得通,任何绘图命令都会转到该显示,我可以使用 vnc 客户端查看.
what worked is, I installed a GUI in the remote system. Then installed vnc and configured it by running vncserver. Which gives a display number, say 5.0. I then put the environment variable in PyCharm to DISPLAY=:5.0 in the project settings. That worked, and any plot command goes to that display, which I can view with vnc client.
仍然存在错误:Xlib: extension "RANDR" missing on display ":5.0" 但正如@Hamish Moffatt 所述,可以忽略.
There is still an error: Xlib: extension "RANDR" missing on display ":5.0" But as mentioned by @Hamish Moffatt, it can be ignored.
这篇关于【pycharm远程python控制台】:“无法连接X服务器"导入 pandas 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:【pycharm远程python控制台】:“无法连接X服务器&


基础教程推荐
- 修改列表中的数据帧不起作用 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 包装空间模型 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01