question

Mike Dorsett avatar image
Mike Dorsett asked

no pip in python?

I'm trying to add a python module (or more to Venus OS. There is no pip installed and when I try to use apt-get to install pip that isn't there either!!.

When is Venus OS going to move to python 3.x?

Venus OSRaspberry Pi
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

6 Answers
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·

Hi Mike, please understand that Venus OS is not a full blown desktop or server oriented Linux distribution. Instead, its an embedded version, with all the advantages as well as limitations that come with that.


there is no apt-get, but there is opkg. And there is no dir, but there is ls.

For more information, study this:
https://www.victronenergy.com/live/open_source:ccgx:commandline


and this:

https://github.com/victronenergy/venus/wiki/commandline-introduction


And this:

https://github.com/victronenergy/venus/wiki/installing-additional-python-modules (could be outdated!)


And while at it, study the rest of the pages on the venus github wiki as well.


Python3 move is in progress, there is an issue open for it, you can keep an eye on that as well as meta-victronenergy to see progress.


enjoy the day, Matthijs

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

olafd avatar image
olafd answered ·

With a clean VenusOS-System pip3 could be installed like this.

~# opkg update
~# opkg list | grep pip
~# opkg install python3-pip

and with VenusOS-Lange-v3.00~14 - pip Version 20.0.2-r0 gets installed.


If this:

~# python3 -m pip3 install --upgrade pip3

or this:

~# python3 -m pip install --upgrade pip3

is execute - pip doesn’t work anymore.


With this command:

~# opkg remove python3-pip

you could remove pip and restart the pip-installation if you need pip3 again.


Version-Check:

~# python3 --version
Python 3.8.13
~# python -m pip --version
pip 20.0.2 from /usr/lib/python3.8/site-packages/pip (python 3.8)
~# cat /opt/victronenergy/version
v3.00~14
Victron Energy
20221221202311
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

henrik avatar image henrik commented ·

Thanks, this worked in VenusOS v2.93 as well

0 Likes 0 ·
dirkmuc avatar image
dirkmuc answered ·

You can install pip

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py

and then

python get-pip.py


2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mike Dorsett avatar image Mike Dorsett commented ·

File "get-pip.py", line 82, in bootstrap

from pip._internal.cli.main import main as pip_entry_point

File "/tmp/tmphUUG4i/pip.zip/pip/_internal/cli/main.py", line 10, in <module>

File "/tmp/tmphUUG4i/pip.zip/pip/_internal/cli/autocompletion.py", line 9, in <module>

File "/tmp/tmphUUG4i/pip.zip/pip/_internal/cli/main_parser.py", line 7, in <module>

File "/tmp/tmphUUG4i/pip.zip/pip/_internal/cli/cmdoptions.py", line 25, in <module>

File "/tmp/tmphUUG4i/pip.zip/pip/_internal/cli/progress_bars.py", line 12, in <module>

File "/tmp/tmphUUG4i/pip.zip/pip/_internal/utils/logging.py", line 18, in <module>

File "/tmp/tmphUUG4i/pip.zip/pip/_internal/utils/misc.py", line 9, in <module>

ImportError: No module named getpass

????? First command worked fine, second gave the above error?


0 Likes 0 ·
dirkmuc avatar image dirkmuc Mike Dorsett commented ·
Ok, I have never seen such failures when installing pip. I am running the large version of Venus OS on a RPi4. I do not know if there is a difference between "normal" and large wrt Python.
0 Likes 0 ·
Mike Dorsett avatar image
Mike Dorsett answered ·

Thanks Guys,

I only started looking into this development a few days ago, and I'm still finding my feet in this. I did also realise that the module I need to install is a slightly customised version, so has to be 'built' in place. I do have the code to do this -

Re the python 3 upgrade, this will cause a major rewrite to some applications as for one instance in python 2.7 the return statement does not need parenthesis whereas in python 3 they are mandatory.

I'm trying to migrate my bms software which runs on the Pi to the Venus OS.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mike Dorsett avatar image
Mike Dorsett answered ·

I upgraded Venus to latest 2.72~4 and now have pip - but some other errors still. Still, a lot more working, and there appears to be a version of gcc which was the root cause of the problem trying to build the spi module.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

tika avatar image
tika answered ·

I'm on v3.00~15 trying to install pip and get error "ModuleNotFoundError: No module named 'colorsys'" when running "python3 -m ensurepip". The pip version is "pip-22.0.4", python is Python 3.8.13.

My assumption is that this is not pip install issue but rather a missing module in python3 on VenusOS. Am I right?

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mike Dorsett avatar image Mike Dorsett commented ·
yes that is most likely the case. I seem to recall getting that error when trying to install the gpiozero module - there were several dependencies that were not automatically filled.

Currently switched to Beaglebone black due to lack of pi's.


0 Likes 0 ·