python无法初始化设备_Python spyder无法初始化GLX

1586010002-jmsa.png

Trying to setup a desktop station for image processing. I recently installed ubuntu 16.04 and went through the guide by Adrian to install python3, cv2, and virtual enviroments.

Instead of using cv2 3.1.0, I used cv2 3.2.0 but besides that, everything was the same.

after installing correctly and running the various tests, I confirmed that python3 was working and cv2 was linked to python.

As I am used to graphical interfaces, I decided to install spyder as it has a nice GUI system. I have done this before on 2 separate devices (a laptop and a raspberry pi 3). However, upon installing on this desktop computer I ran into a weird problem.

When ever I run spyder, It results in the error below

Could not initialize GLX

Aborted (core dumped)

I have been looking online for solutions but I cannot seem to find an answer to this problem

edit: I went searching for core dump files on ubuntu and I found a bunch of files all containing the same code 00000033.

解决方案

First of all, for our understanding:

GLX (initialism for "OpenGL Extension to the X Window System") is an

extension to the X Window System core protocol providing an interface

between OpenGL and the X Window System as well as extensions to OpenGL

itself. It enables programs wishing to use OpenGL to do so within a

window provided by the X Window System. GLX distinguishes two

"states": indirect state and direct state.

Any way, I had a similar problem with QT installation and solved it installing the following package: libgl1-mesa-dri

sudo apt-get install libgl1-mesa-dri

Another similar solution I found was:

sudo apt-get purge nvidia*

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.orig

sudo rm /etc/X11/xorg.conf

For 32-bit,

sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx:i386 libgl1-mesa-dri:i386

For 64-bit

sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx:amd64 libgl1-mesa-dri:amd64

sudo dpkg-reconfigure xserver-xorg

I hope it helps you.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值