Installing SetupTools / distutils on Python 3.8 Embedded device

49 views Asked by At

I have an embedded device (modem) that runs linux and has Python 3.8.12 installed. It does internet access (ping, curl, etc works) but pip is not installed.

Also, there is no apt, so I can't install with a package manager. This is Yocto build, which I know nothing about.

I have had success installing packages manually by downloading the package and using: python3 setup.py install

I have been trying to install schedule (https://pypi.org/project/schedule/) and it has an import statement for 'from setuptools import setup'

I downloaded the source for setup tools, scp to a folder on the device, went into the directory and ran 'python3 setup.py install'

It will run and install and when I run 'python3' shell and then

root@mydevice: python3
from setuptools import setup
> >>

It does not complain, and gives me another prompt which to me seems like it is working

If I reboot or open another SSH window or reboot the device, and do the same thing...

root@mydevice:~# python3
Python 3.8.12 (default, Aug 30 2021, 16:42:10)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from setuptools import setup
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 18, in <module>
from setuptools.extension import Extension
File "/usr/lib/python3.8/site-packages/setuptools/extension.py", line 3, in <module>
import distutils.core
ModuleNotFoundError: No module named 'distutils'

I have checked '/usr/lib/python3.8/site-packages/setuptools/' and setuptools is there, so it seems like the install worked.

Everything is installed as root as it is the only user.

Any idea what is going on?

I can't find source for distutils and everything I have read says that setuptools provides distutils anyway.

TLDR version: I tried to manually install setuptools, seems to work, doesn't survive reboot or even another ssh session

0

There are 0 answers