10879 questions

12962 answers


26087 members

+3 votes
639 views 27 comments
Hi, everyone

I have installed Python 3.7 on a TRB140 using 'opkg install python3-light'. The installation completed succesfully. When I run 'python3' or execute a python-script then the following error appears:

Error relocating /usr/lib/libpython3.7.so.1.0: getrandom: symbol not found

I have no working resolution. Can anybody help?

Regards, Mike
firmware version V7.01 seems to have fixed this issue by updating the base openwrt to 21.02

please check


Yes, the latest firmware V7.02 is openwrt 21.02 based and Python is working. Thanks!

Newest firmware did not fix this issue

1 Answer

0 votes

Could you please check if other opkg packages work normally and are installed correctly?

Check if you have the latest firmware version? Try resetting the router to default factory settings?

If you're able to install others and use them and only a little part of packages return with errors like that - I'm afraid there's nothing we can do, as this is a third-party package and it's not included in our base functionality.

Your best bet would be waiting for a newer firmware version as it should include a little newer OpenWRT update.

1 - looks like you have a SDK version already containing a getrandom.c file, so the patch is not required. Which version do you use ? What is the content of the original file ?

2) extract the source in the base directory and make menuconfig to enable it, copy libgetrandom.so to the target device and use it as LD_PRELOAD=./libgetrandom.so python3 ...
I'm using the latest SDK available from Teltonika, so TRB1_R_00.07.01.2

I cannot find the file in the SDK, do I have to check for it during runtime on the target device?

Regarding 2): With base directory you mean the base directory of the sdk or the target device? Sorry for asking these possibly trivial questions but I'm new to building firmwares with the SDK.
Just checked, getrandom.c is in build_dir/toolchain-mips_24kc_gcc-8.4.0_musl/musl-1.1.24/src/linux. It is downloaded so it appears only after a make. The 902-xxx pacth is redondant, don't use it in this version (and delete it if it is present).

2) the folder where it resides, for me rutos-ath79-trb2-gpl
Thank you very much so far. I did not find any options to enable it in the menuconfig menu, can you hint me in the right direction one last time?
It is in the Libraries sub-menu, but you shouldn't need it as getrandom() is included in the musl library in this version.