[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/libgcc_4.8-linaro-1_ramips_24kec.ipk
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/libc_0.9.33.2-1_ramips_24kec.ipk
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/libpthread_0.9.33.2-1_ramips_24kec.ipk
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/zlib_1.2.8-1_ramips_24kec.ipk
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/python-mini_2.7.3-2_ramips_24kec.ipk
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/libffi_3.0.13-1_ramips_24kec.ipk
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/python_2.7.3-2_ramips_24kec.ipk
[root@PandoraBox:/mnt/sda1/opkg]#opkg -d usb install /mnt/sda1/ipk/libopenssl_1.0.2f-1_ramips_24kec.ipk
[root@PandoraBox:/mnt/sda1/opkg]#opkg -d usb install /mnt/sda1/ipk/python-openssl_2.7.3-2_ramips_24kec.ipk
[root@PandoraBox:/mnt/sda1/opkg/usr/bin]#opkg -d usb install /mnt/sda1/ipk/python-json_3_4-1_ramips_24kec.ipk
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/libpolarssl_1.3.9-2_ramips_24kec.ipk
Installing libpolarssl (1.3.9-2) to usb...
Configuring libpolarssl.
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/libcurl_7.38.0-1_ramips_24kec.ipk
Installing libcurl (7.38.0-1) to usb...
Configuring libcurl.
[root@PandoraBox:/root]#opkg -dest usb install /mnt/sda1/ipk/python-curl_7.19.0-1_ramips_24kec.ipk
Installing python-curl (7.19.0-1) to usb...
Configuring python-curl.
[root@PandoraBox:/mnt/sda1/projects/openwrtpytest/utils]#opkg -d usb install /mnt/sda1/ipk/libexpat_2.1.0-1_ramips_24kec.ipk
Installing libexpat (2.1.0-1) to usb...
Configuring libexpat.
[root@PandoraBox:/mnt/sda1/projects/openwrtpytest/utils]#opkg -d usb install /mnt/sda1/ipk/python-expat_2.7.3-2_ramips_24kec.ipk
Installing python-expat (2.7.3-2) to usb...
Configuring python-expat.
安装好后
root@PandoraBox:/mnt/sda1/opkg/usr/bin]#/mnt/sda1/opkg/usr/bin/python
Python 2.7.3 (default, Sep 24 2014, 18:21:25)
[GCC 4.8.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
设置环境变量
echo 'export PATH=$PATH:/mnt/sda1/opkg/usr/bin' >> /etc/profile
需要下次登录才生效,使用export可以查看PATH值
export
这样直接用python就可以使用了
装好后并非就万事无忧了,发现还有很多丰富好用的库要么装不了,要么运行不了
安装easy_install
[root@PandoraBox:/mnt/sda1/projects/openwrtpytest/utils]#sh /mnt/sda1/egg/setuptools-0.6c11-py2.7.egg
安装Pip
easy_install pip
python的基础库lxml卡在ctypes这个错误不能继续使用,如果我改变so文件会导致"' is not an ELF executable for MIPS",于是我干脆把ctypes里面出错的coding 注释掉,这样至少lxml可以解析了
pip也是会报错,所以我都是从一个虚拟机ubuntu上用pip安装好库后全部拷贝到
/mnt/sda1/opkg/usr/lib/python2.7
大部分可以直接使用,还有些是实在用不了,只好找替代库
python: '/mnt/sda1/opkg/usr/lib/python2.7/lxml/etree.so' is not an ELF executable for MIPS
BeautifulSoup , numpy , pandas,pyquery,lxml都不能用
py-linq,tinydb 替换 pandas
xmldict,HTMLParser,sgmlib替换 BeautifulSoup ,pyquery
pickledb替换redis
这些麻烦些也能用,然而,我至今没在上面安装成功数据库,mysql,mongodb,sqlite,redis,统统运行不了
失败的尝试就不写了。。。烦心