Python 3.11 venv altinstall in EV3dev Debian 10 'Buster' experimental image #1634
Replies: 5 comments 6 replies
-
Here is a list of simple files we have run so far to do a basic check the ev3dev packages in the 'Buster' Python 3.11 venv: https://github.com/Growflavor/EV3projects/tree/main/Python311_venv_Tests GyroBoy on EV3dev So far, the only issue we have encountered remains the message about buttons:
RE: "EV3 itself has an interface with unreadable text (((" I speculate that one of the font or other packages has not been added or updated in your image...I had to add MANY packages to the base ev3dev Bullseye image...better if we follow up on that topic over at #1554 |
Beta Was this translation helpful? Give feedback.
-
hi! I just tried to install this ev3dev image onto my robot, and ran into a confusing issue would you be able to explain how to get around this issue? |
Beta Was this translation helpful? Give feedback.
-
W.i.P 2024: Tracking Kernel Buildscripts Updates from Forkshttps://github.com/ev3dev/ev3dev-buildscripts original kernel configs: kernel changes of interest:
universal changes:
** @StepanTheFlowey Buildscripts & Kernel Forks:**
|
Beta Was this translation helpful? Give feedback.
-
when i follow the provided link to the image I get the message: I am finding it impossible to install python packages in stretch as the debian packages do not seem to be available. specifically i am trying to install pyzmq which are python binding for the c package 0mq which i also cant install. i want to try a newer release of debian to see if i have more luck. there seems to be packages available so should be easier. im a bit of a novice though for anything beyond pip install and using pip doesnt seem to be an option. installing debian packages directly is a bit new to me and i am a bit unsure of what i am doing tbh. |
Beta Was this translation helpful? Give feedback.
-
The EV3 does benefit dramatically from the performance improvements in Python 3.11:
source: https://flyaps.com/blog/python-3-11-release-features-overview/
Python 3.11 vs Python 3.12 – performance testing
A Python 3.11 venv is included in the following Debian 10 "Buster" image that brings together into one image dlech's prior work.
This is currently the 'goto' EV3dev image that my son & I use for all our EV3 projects...
Try out your favorite programs & run test programs to evaluate the 'if useable' functionality of features introduced since python 3.5 in the Python 3.11 venv ... all that is needed is to change the shebang at the start of your python file to:
#!/home/robot/venv311/bin/python3.11
Please reply to this discussion with the results (& link to your code if available online)!
A) Image to flash to SDcard via Balena Etcher available for download:
NOTE: please see the comment below for details on the reboot during just the FIRST Boot after flash.
https://drive.google.com/file/d/1Y8g46pREtF-7YdmpBeYbCxqt2HyAJkv0/view?usp=drive_link
ev3dev10img02b.zip SHA-256: B9E7D392579570023441A20236C0E2398FFF3B7267C1C20C5CBE996D0FF692D3
ev3dev10img02b.img SHA-256: B33787680AC4575D59A7C739EB531E4F4F553AF230B33F25A87D84A1FD5DAD72
B) here is a link to the docker image used to make the above image so that you can modify packages to meet your needs & build your own sdcard images using Brickstrap for this Debian 10 "Buster" draft v02:
--the py3.11 venv pip builds wheels from source...so use docker to add more packages to the venv...
--using apt is painful onboard the EV3, so easier to:
update the image using a docker container:
--make changes/updates in a docker container on a machine with a favorite brickstrap/docker setup:
commands below are for docker running on linux...
& in this case sudo is used since it is easier with Ubuntu running via Windows WSL2
details about brickstrap: https://github.com/ev3dev/brickstrap
--you will get a robot@ prompt, make the updates/changes you want inside this container, then logout from the robot@ prompt
--then commit the docker container you just updated to a docker image (docker ps -a will show the image(s) & ID#):
--then use brickstrap to make a new .img from your updated docker container to flash with Etcher, for example:
You may return to your stopped container (use your container's name i.e. not quizzical_wright ) to make further changes/updates anytime by starting it:
or if it is still running you can activate a shell to resume work with syntax like:
you can also copy files out of the container with syntax like this:
Some details about the "Buster" experimental image:
robot@ev3dev:$ python --version
Python 2.7.16
robot@ev3dev:$ python3 --version
Python 3.7.3
robot@ev3dev:$ python3.11 --version
Python 3.11.9
robot@ev3dev:$ source venv311/bin/activate
(venv311) robot@ev3dev:$ python --version
Python 3.11.9
(venv311) robot@ev3dev:$
(venv311) robot@1d282c75b987:~$ pip list
Package Version
beniget 0.4.1
certifi 2024.6.2
cmake 3.28.3
compilers 0.0.0
contourpy 1.2.1
cppy 1.2.1
cycler 0.12.1
Cython 3.0.10
fonttools 4.53.0
gast 0.5.4
kiwisolver 1.4.5
matplotlib 3.8.4
meson 1.4.1
meson-python 0.16.0
ninja 1.10.2.3
numpy 1.25.2
packaging 24.1
pillow 10.3.0
pip 24.0
plumbum 1.8.3
ply 3.11
pybind11 2.12.0
pyblas 0.0.10
pyparsing 3.1.2
pyproject-metadata 0.8.0
python-dateutil 2.9.0.post0
python-ev3dev 1.2.0
python-ev3dev2 2.1.0.post1
pythran 0.16.1
rpyc 5.3.1
setuptools 70.0.0
setuptools-scm 8.1.0
six 1.16.0
wheel 0.43.0
(venv311) robot@1d282c75b987:~$
To use the python 3.11 venv just change the shebang at the start of your python file to:
#!/home/robot/venv311/bin/python3.11
You may also RPyC to the venv:
venv RPyC server bluetooth example:
python3.11 ./py11venv/bin/rpyc_classic.py --host=169.254.109.129
venv RPyC server LAN example:
python3.11 ./py11venv/bin/rpyc_classic.py --host=192.168.0.103
-- VScode has a jupyter note book extension so you can have a notebook open directly in VScode served from the same .venv you use for the pylance interpreter & use RPyC 5.3.1 to directly control your EV3 by notebook code cells
you may also RPyC to the 'Buster' system Python 3.7:
robot@ev3dev:~$ hostname -I
192.168.1.110
then activate the EV3 RPyC server using the IP shown by hostname -I:
sudo python3 /usr/local/bin/rpyc_classic.py --host=192.168.1.110
& of course, some common 'sudo apt install' Python 3.7 system packages as well in this image:
pybricks-micropython: GyroBoy runs OK
openrobertalab: connects
& Just using pip to list...these are system package manager 'apt' installed (except for RPyC==5.3.1)
Some additional notes:
--the above image is a make of the default Py3.11 ./configure (& only module _dbm did not build)
so if you want to make & altinstall a different Py3.11 ./configure such as minimal
https://docs.python.org/3.11/using/configure.html
then look at /usr/local/src in this image:
docker pull growflavor/ev3images:ev3dev10makepy11
--If you encounter memory limits, then I suggest stopping the openrobertalab service when you want to use the venv:
sudo systemctl stop openrobertalab
Beta Was this translation helpful? Give feedback.
All reactions