Installing pysnmp module for python
-
Hi everyone, I'm trying to install the pthon module pysnmp as I am attempting to set up a snmp responder so that my device can be controlled with snmp. The first problem I ran into was lack of memory, so I solved that with making a 2GB swap partition on my sd card. Now I'm running into the following and not sure how to fix it. I've tried searching google and here and I can't seem to find anything relevant.
───────────────────────────────────────────────
unable to execute 'mipsel-openwrt-linux-musl-gcc': No such file or directory
error: command 'mipsel-openwrt-linux-musl-gcc' failed with exit status 1ERROR: Failed building wheel for pycryptodomex
───────────────────────────────────────────────
-
@Jeffrey-Lavoie the error indicates the gcc compiler cannot be found in your path, this compiler is used for crosscompiling C code on linux.
-
Ok, so if I just install gcc it should be fine? I was thinking it was some kind of special version of gcc because of the long command name it gave and I couldn't find any references online to that command. I'll give that a try.
-
@Jeffrey-Lavoie you use this compiler to cross compile. So you compile the code on linux then move the files to OpenWrt.
An easier way to install pycryptodomex is to use pip
pip install pycryptodomex
If you don't have pip installed you can just install it:
opkg install python-pip
Make sure you have updated your distfeeds.conf so the package can be found.
-
This was with me actually installing pysnmp on the omega with "pip install pysnmp", so it was trying to compile it on the omega and I'm guessing even if I did "pip install pycrpytodomex" it would have had the same results.
installing gcc, after uncommenting the base and packages lines for openwrt in /etc/opkg/distfeeds.conf, seemed to do the trick. Though, I ran into another problem. It ran out of free space, not on my sd card, but on the /tmp mount. I'm not sure how to increase that, or if I really need to, but for anybody else that might come across this the solution was to specify a build folder for pip like this.
pip install --build /root/tmp pysnmp