GtkWarning: could not open display

后端 未结 2 1432
执念已碎
执念已碎 2021-01-07 06:21

I am trying to run a spider on a vps (using scrapyjs which uses python-gtk2). On running the spider I am getting the error

/root/myporj/venv/local/lib/python         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-07 06:44

    Probably you run the application over ssh? Then, you need to run X server on local PC. If not, you should set DISPLAY environment variable correctly. Recently, sudo command on Ubuntu doesn't some transfer environment variable. If you run the application over sudo, make sure $DISPLAY is set or not.

    Additional

    It's a bug of pygtk. You app should be depend on gtk widget.

    https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/800574

提交回复
热议问题