由于tk1是arm架构的,很多库的安装依赖都很奇怪,由此导致下面一系列坑:
1 源的问题:
默认的源不知道为何无法apt-get了,然尝试用USTC 还有163的源,在apt-get update的时候都报错 关于armhf的
解决方案:使用下面的源
SOLVED!
It could be useful for others (that's strange i'm the only that faced this issue!):
since Ubuntu raring has reached EOL and packages removed, i tried to find packages on other sites. I found that when a release is at EOL packages are moved in old-releases.ubuntu.com!
So, it's enough you edit the /etc/apt/sources.list file, cancel the previous line and insert the following new lines:
deb http://old-releases.ubuntu.com/ubuntu/ raring main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-security main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-security main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-updates main universe restricted multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-updates main universe restricted multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ raring-proposed main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ raring-proposed main restricted universe multiverse
then save, close and in terminal sudo apt-get update.
2. 使用sudo apt-get install python-pip时
各种提示缺少包,按照提示下载包时 又说版本不对
解决方案:
sudo apt-get purge python-pkg-resources
Once completed successfully, first run
sudo apt-get -f install
then
sudo apt-get install python-pip
3. pip install时显示缺少证书(使用如下的方法均未解决问题,解决第4个坑时,重装了pip ,选择了第一y,然后再安装build-essensial,不过似乎没安装上,anyway,解决了)
Could not fetch URL https://pypi.python.org/simple/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed>
解决方案:
方案1.
pip install --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org pythonPackage
方案2
pip --cert /etc/ssl/certs/FOO_Root_CA.pem install pep8
This is not nice (curl and other libraries find the cert without adding a parameter) but works.
If you don't want to use the command line argument, you can set the cert in ~/.pip/pip.conf:
[global] cert = /etc/ssl/certs/Foo_Root_CA.pem
|
edited
Nov 25 '13 at 8:34
|
answered
Oct 16 '13 at 8:33
|
|
up vote
14 down vote
|
My solution is downloading cacert.pem from http://curl.haxx.se/ca/cacert.pem and add the path forcacert.pem to ~/.pip/pip.conf as guettli suggested
[global] cert = /path/to/cacert.pem
|
4.有些包需要依赖库,然后get依赖库又需要其他依赖库,然后这个依赖库又需要特定版本 各种循环的装不上
解决方案:
sudo apt-get install aptitude
然后不用apt-get装那个包,而用aptitude,它会给出需要保留那些库的版本,可以选n,然后它会给出另外的方案
如:
sudoaptitude install libjpeg-dev
5.后来发现有些问题似乎是系统时间的问题
解决方案:
与时间服务器上的时间同步的方法
1. 安装ntpdate工具
# sudo apt-get install ntpdate
2. 设置系统时间与网络时间同步
# ntpdate cn.pool.ntp.org
3. 将系统时间写入硬件时间# hwclock --systohc
6.pip install Pillow时出现error:
ValueError: --enable-jpeg requested but jpeg not found, aborting
基本就是知道缺少一些库,找了很多,都没用,反复的卸载,反复的get,最后找到这个:
sudo apt-get install mime-support python-pil.imagetk libc6 libfreetype6 libjpeg8 liblcms2-2 libtiff5 libwebp5 libwebpmux1 zlib1g python-pil-dbg python-dev libjpeg-dev libfreetype6-dev zlib1g-dev
ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/
有一些库装不了的,就删掉,然后sudo pip install Pillow==2.7 -i http://pypi.douban.com/simple
意外的成功了。。。
(PS 后面发现还是不行,使用sudo pip install -I PIL 可以查看支持哪些格式的解码,发现都是不支持的)
然后find -name libjpeg.so 发现应该是将./arm-linux-gnueabihf/libjpeg.so 链接到 /usr/lib中,不过需要先将之前的删掉
然后 ln -s /usr/lib//arm-linux-gnueabihf/libjpeg.so /usr/lib 以及将libz libfreetype都放过去
7.装python-opencv
首先参考
sudo apt-get install libcv-dev libcvaux-dev libhighgui-dev opencv-doc python-opencv
能装多少是多少吧
然后用 sudo aptitude install python-opencv
先选n,再选y(因为第一个就是全部维持原状)
然后ok了,aptitude是个好东西!
PS: pip没速度可以使用 -i http://pypi.douban.com/simple用国内的源
8.因为是用来装webcam-streamer,源代码需修改(直接用pip 出现format错误,不知道是不是git源码改了,直接使用几天前下载的源码)
cd到目录下 用sudo python setup.py install安装
安装完,里面有一句
from StringIO import StringIO
需要改成import StringIO
遇到错误:
ImportError: No module named sgunicorn
尝试pip install gevent-websocket与gevent-socketio
中间会遇到下依赖文件不走国内源的问题,手动把这些依赖给pip装好,如versiontools这些
且sudo pip install Flask-SocketIO==0.6.0固定版本
然后还是有错误
cannot import name socketio_manage
最后 实在受不了了,直接把之前在阿里云上的目录下的socketio复制过来了(之前阿里云总共配置时间不超过半小时。。。。)
over
subprocess.Popen(['ls', '/dev/video0'])