X服务器远程连接问题
报错1
ImportError: this platform is not supported: (\’failed to acquire X connection: Bad display
name \”\”\’, DisplayNameError(\’\’)) Try one of the following resolutions: * Please make sure
that you have an X server running, and that the DISPLAY environment variable is set
correctly
这个错误表明程序依赖于 X 服务器,但它无法找到 X 服务器或者 $DISPLAY 环境变量没有设置正确。
在你的情况下,程序在尝试导入 pynput 模块时出现了问题。pynput 模块通常用于捕获键盘输入,它需要一个可用的 X 服务器来工作。
报错2
[2370019:0406/114907.428655:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
[2370019:0406/114907.428695:ERROR:env.cc(255)] The platform failed to initialize. Exiting.
The futex facility returned an unexpected error code.
在多用户环境下,每个用户可以通过设置不同的 DISPLAY 环境变量来指定他们要使用的 X 服务器显示编号。一般来说,X 服务器的显示编号从\”:0\”开始,然后依次递增。当用
评论前必须登录!
注册