OpenWrt Forum Archive

Topic: Trouble installing python packages

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have some software I wish to run on the tplink 703n 15gb extroot, 1gb swap, but it is fighting me every step of the way.

I am currently using chaos calmer r45886 and I tried to install python-pip which was successful, but every command I issued from "search" to "install" resulted in a "SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] unknown error" I've tried rectifying this the best I could such as applying a CACERT from a good company but nothing I did could fix it.

I gave up and downloaded and installed pip 1.2.1 which I believe was the last known version that didn't use SSL. But now with that installed every time I try to install a package it searches in the wrong base directory and tells me the package does not exist even though it clearly does (after all "pip search Twisted" showed results). It keeps wanting to search http://pypi.python.org/simple/ even if I specify the -i flag to change the url it doesn't help.

After that I tried to download the Twisted source itself and use easy_install to install it, but it was complaining about mips gcc not being found, go figure.

So now I'm here with a project I wan't to get working on this router and no way to get the packages I need on it.

Is there a guide or a simple way to cross compile the python modules I need? I have the buildroot installed and working and I need at least 10 python modules which I can't find anywhere in the openwrt repos.

Here is a list of some packages I need. I may not need all of these, but most of them I do:

Twisted
requests
scapy
msgpack-python
dnspython
dnslib
configobj
Pillow
pefile
ipy
pyopenssl
service_identity
watchdog
impacket
capstone
pypcap


Thanks for any help or suggestions for getting any of this working.

(Last edited by abduct on 7 Jun 2015, 22:05)

I just created this wiki page, it should help a bit, but please contribute to this wiki page with additional information:
http://wiki.openwrt.org/doc/software/python

(Last edited by valentt on 8 Jun 2015, 12:56)

valentt wrote:

I just created this wiki page, it should help a bit, but please contribute to this wiki page with additional information:
http://wiki.openwrt.org/doc/software/python


Unfortiently that wiki page does not address my question, although if I find out any of my information I am looking for I will add the steps to accomplish it.

-----------------------------------------------------------------------------

I ask again, does anyone have the steps or information about cross-compiling python packages on an x86_64 host so that I may install them onto openwrt? Using pip or easy_install fails on most packages because of the need of a GCC compiler which is not present on the router.

I've managed to cross-compile C projects the last few days, but I am clueless as how I can use the openwrt SDK build environment for premaking python packages that need code compiled.

(Last edited by abduct on 9 Jun 2015, 22:05)

I'm a Python noob but I thought that point of Python was that it doesn't need compiling. But regarding recompiling packages, why not start by looking at existing OpenWrt Python packages and how they are compiled, maybe that gives you a clue.

The discussion might have continued from here.