主要步骤:
1.卸载系统里的Nvidia低版本显卡驱动
sudo apt-get purge nvidia*
2.把显卡驱动加入PPA
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
3.查找显卡驱动最新的版本号
查找并安装最新驱动
sudo apt-cache search nvidia
返回如下结果:
ubuntu-drivers devices
采用apt-get命令在终端安装:
sudo apt-get install nvidia-390 nvidia-settings nvidia-prime
4.重启系统并验证
在终端输入以下命令行:
lsmod | grep nvidia
5.(可选)停止当前版本的本地更新
sudo apt-mark hold nvidia-390
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/lucas/Download/opencv-2.4.13.6/modules/highgui/src/window.cpp, line 501
Traceback (most recent call last):
File “video.py”, line 191, in
cv2.imshow(‘capture %d’ % i, img)
cv2.error: /home/lucas/Download/opencv-2.4.13.6/modules/highgui/src/window.cpp:501: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage
这个错误的大概意思是安装opencv前有一些库没安,所以要先卸载干净安完相关库重新安装opencv即可。
首先找到安装opencv的build文件夹,依次执行
- $ sudo make uninstall
- $ cd …
- $ sudo rm -r build
- $ sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
这一步可能有error
下面执行如下操作: - sudo apt-get –purge remove opencv-doc opencv-data python-opencv
安装前更新一下:
sudo apt-get purge python-opencv
sudo apt-get update
sudo apt-get upgrade
最关键的一步,
不管3721直接把所有相关库一次性安装完
sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev default-jdk ant libvtk5-qt4-dev
sudo apt-get install python-opencv
接下来安其他包建议采用以下方式:
sudo apt-get install python-numpy
sudo apt-get install python-scipy
sudo apt-get install python-matplotlib
sudo apt-get install python-pandas
sudo apt-get install python-sklearn