我刚刚点亮这块板子的第一件事就是看看这玩意儿有没有中文输入法。点开屏幕右上角的输入法菜单,发现里面第二项就是“pinyin”,然鹅,当我兴奋的点击拼音的时候,却发现 点 不 了!!!(不知道大家有没有遇到这种情况,我反正是遇到了)
没办法,只好自己找了个ubuntu安装输入法的教程,照着弄了一番,本文关于输入法的教程基本上与这个教程相同,此处附上我参考的教程链接:http://blog.csdn.net/suxiang198/article/details/52040283
当然,用惯了搜狗输入法的可以直接去安装搜狗,博主只是从来不用搜狗而已,此处安装的是ibus的拼音输入法。
如果你在配置系统的时候就选择了中国,理论上讲应该已经安装好了中文语言包(不然为啥一开始就有一个点不了的pinyin嘞)不过以防万一,我们检查一下。
通过System setting->Language Support->Install/Remove Languages…出现的对话框中,查看一下Chinese有没有被选中,没有被选中的话就选一下。
安装ibus框架,在Terminal中输入:
sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4
切换到ibus框架下:
im-config -s ibus
安装拼音引擎:
sudo apt-get install ibus-pinyin
调出ibus Preference来添加该拼音输入法:
sudo ibus-setup
在弹出的对话框中添加Chinese-Pinyin输入法就好啦~
在System Settings–>Text Entry中添加上ibus拼音输入法,并将Show current input source in the menu bar勾选上,这样就会在系统的菜单条上显示输入法切换的图标了。
由于ubuntu默认的软件源是国外的源,下载速度非常慢,而且经常链接中断,非常不稳定。博主是先安装pip来着,安装了一天多,各种断网,断网了就要中重新来,心态爆炸,,,这才想起来换软件源这么个事,,,(cry,,,)
首先要备份一下原始文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
打开文件
sudo gedit /etc/apt/sources.list
添加国内源,我添加了这么一堆:
#Ubuntu 官方源
deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
#阿里云
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
#网易163
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
#中科大
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main restricted
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main restricted
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security multiverse
为防止非官方源的包不完整,可在外部添加官方源
deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse
更新源
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get upgrade
此时的系统里pip和pip3都没有,博主用python3,所以就安装pip3了,
sudo apt-get install libhdf5-serial-dev hdf5-tools zlib1g-dev zip libjpeg8-dev libhdf5-dev python3-pip
pip3 install -U numpy
pip3 install -U h5py
pip3 install -U grpcio absl-py py-cpuinfo psutil portpicker grpcio six mock requests gast astor termcolor
换过软件源以后,下载还是挺快的,但是安装很慢,耐心等待一下吧
博主发现,这个系统默认的python还是python2,系统自带opencv3.3.1,但是也是跟python2关联的。
Terminal输入python
,可以看到是python2.7。在此处输入import cv2
没有报错,再输入cv2.__version__
可以看到opencv的版本是3.3.1。若需使用python2调用opencv的话,就可以直接使用了。
python3可以用命令python3
打开,可以看到这里是python3.6。输入import cv2
,直接报错,说明python3没有关联opencv。
然鹅博主并没有找到opencv的cv2.so文件,使用pip3直接安装也不行,现在还在尝试使用python3调用opencv中。。。如果大家有知道如何用python3调用opencv的,欢迎与博主交流一下~~~