Python3 venv failed

I tried do virtual environment (venv) for some python application, but it is not possible due missing “ensurepip” module in main python. There is no way to install it by opkg even by pip.

root@turris:/srv# python3 -m venv venv
Error: Command ‘[’/srv/venv/bin/python3’, ‘-Im’, ‘ensurepip’, ‘–upgrade’, ‘–default-pip’]’ returned non-zero exit status 1.

At “fat” PC I tried import ensuerpip and that work, under turris not.

Is there any chance to include this module to main python? I do not want run LXC just because one small python flask service. Also do not know i LXC will have access to /dev/ttyUSBx device

TurrisOS 5.3.5, Turris Omnia

Regards Petr
P.S> When we will go to turris beer? :slight_smile:

When you will organize event?

1 Like

I have the same problem. Is there any solution/workaround for this?

Thanks in advance,
Sandor

I found a workaround; in case someone else needs it:

root@turris:/srv# python3 -m venv venv --without-pip
root@turris:/srv# source venv/bin/activate
(venv) root@turris:/srv# wget https://bootstrap.pypa.io/get-pip.py
(venv) root@turris:/srv# python3 get-pip.py

BR,
Sandor

4 Likes