PiDog V2 vilib Installation - vilib install seems to hang indefinitely

I have successfully downloaded the vilib package to the Raspberry Pi 5 using the provided terminal commands however when running the install.py, the installation is hanging with the following showing in the terminal..

Start installing vilib 0.3.18 for user *********
Python version: 3.13.5
Raspbian version: 13 (64bit)

mediapipe is only supported on 64bit system with python 3.12 or older.
tflite-runtime is only supported on python 3.12 or older.
Install vilib python package

  • pip3 install ./ … Done
  • cleanup … Done
    apt install dependency:
  • dpkg configure … |

From here the progress bar will spin, seemingly forever. I’ve tried re-downloading the module package from GitHub and still get the same result. Is anyone able to shed some light on this problem?

Gratefully,

Wishbone

How long did you let it wait? Sometimes it can take like 5 minutes to do anything.

I was hoping that was the case as well, unfortunately all attempts were left for over an hour, and once I let it run overnight. No errors, just nothing to say it completed. I’m running on a current raspberry Pi 5 and Trixie

Try running the stalling command manually, you should hopefully get more debug information. It’s

sudo dpkg --configure -a

Hi, thanks for the advice. I’m new to Linux, and only have command line experience from the 80’s DOS days.. so please, at what point word I run that command? For what it’s worth the Pi isn’t frozen and I can use Ctrl C to end the installation. I’m wondering if I should just move on with the PiDog setup and deal with the vilib later when I need to. Is there a chance that the install was successful and the hanging is happening post?
Thanks again for your help :slight_smile:

Ah yes, command line DOS, those were the days.

I cant remember if pidog uses vilib as part of its global initiialisation, independently of whether it then goes on to use the camera or not. I’d suggest just trying it, to at least have a play with some capabilities.

It really should not hang during dpkg configure. You could even start afresh, if not too far down the line, or try same on a 2nd sdcard if you have a spare.

Anyway, the install.py script that you’re trying to run includes the command above as part of its installation. It’s installed everything up to that point successfully according to the log you posted. After installl.py hangs, you have said that you can abort with ctrl-c, so get to this point again, and then simply type above command into the same terminal window. If you get it working, then rerun install.py.

I dont think the media pipe warning matters, as not needed for some examples. I’m assuming that you’re using Trixie? In which case you may wish to drop down to bookworm legacy os, and try everything again from scratch. The mediapipe team don’t seem to have any plans to support python 3.13 any time soon. I.e on Trixie.

Bottom line: If you’re not too familiar wifh linux debug and wish to use all vilib features , I would personally recommend a total restart with bookworm, unless you really need Trixie, in which case try above command. But Sunfounder may have a better recommendation.

To your first point, I agree and I’ll continue with the module installs. I’ve already spent 5 days of this build on paint, and I’m dying to get on with things. I’m sure this won’t be the last time that I start from scratch so getting used to the steps can’t be a bad thing. I also feel like I’ll learn something of the global picture by seeing directly how this issue affects things downstream. That said, I’ll try that command you’ve shown me for sure. I also agree that the mediapipe message is not an error, more of a note.
Thanks a tonne for the concise reply! I’ll keep updating this for documentation purposes and hopefully Sunfounder has some insight to add

Buy a few sdcards to play around with, they’re cheap, and allow you to do regular backups so never too far to go back.

Enjoy!

1 Like

** Please let me know if it is inappropriate to post long strings of copied text as I am about to do! **

@Spf650 great call, I ran the command after cancelling and presto, something happened! see below

@:~/vilib $ sudo python3 install.py
Start installing vilib 0.3.18 for user ratbone
Python version: 3.13.5
Raspbian version: 13 (64bit)

mediapipe is only supported on 64bit system with python 3.12 or older.
tflite-runtime is only supported on python 3.12 or older.
Install vilib python package

  • pip3 install ./ … Done
  • cleanup … Done
    apt install dependency:
  • dpkg configure … ^C

Canceled.
@:~/vilib $ sudo dpkg --configure -a
Setting up rpi-chromium-mods (20260211) …

Configuration file ‘/etc/chromium/master_preferences’
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer’s version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** master_preferences (Y/I/N/O/D/Z) [default=N] ? y
Installing new version of config file /etc/chromium/master_preferences …
Setting up chromium-l10n (1:144.0.7559.109-2~deb13u1+rpt1) …
Processing triggers for mailcap (3.74) …
Processing triggers for desktop-file-utils (0.28-1) …
Processing triggers for initramfs-tools (0.148.3+rpt2) …
update-initramfs: Generating /boot/initrd.img-6.12.47+rpt-rpi-v8
‘/boot/initrd.img-6.12.47+rpt-rpi-v8’ → ‘/boot/firmware/initramfs8’
update-initramfs: Generating /boot/initrd.img-6.12.47+rpt-rpi-2712
‘/boot/initrd.img-6.12.47+rpt-rpi-2712’ → ‘/boot/firmware/initramfs_2712’
Processing triggers for hicolor-icon-theme (0.18-2) …
Processing triggers for cups (2.4.10-3+deb13u2) …
Updating PPD files for cups-filters …
Updating PPD files for escpr …
Updating PPD files for hpcups …
Updating PPD files for postscript-hp …
Processing triggers for gnome-menus (3.36.0-3) …
Processing triggers for libc-bin (2.41-12+rpt1+deb13u1) …
Processing triggers for systemd (257.9-1~deb13u1) …
Processing triggers for man-db (2.13.1-1) …
Processing triggers for libglib2.0-0t64:arm64 (2.84.4-3~deb13u2) …
Processing triggers for shared-mime-info (2.4-5+b2) …
Processing triggers for libvlc-bin:arm64 (1:3.0.23-0+deb13u1+rpt1) …
Processing triggers for debianutils (5.23.2) …
Setting up pi-package (0.19) …
@:~/vilib $

I then re-ran the install.py and with the exception of a few errors, things went much differently than before.. see below

@:~/vilib $ sudo python3 install.py
Start installing vilib 0.3.18 for user ratbone
Python version: 3.13.5
Raspbian version: 13 (64bit)

mediapipe is only supported on 64bit system with python 3.12 or older.
tflite-runtime is only supported on python 3.12 or older.
Install vilib python package

  • pip3 install ./ … Error
  • cleanup … Done
    apt install dependency:
  • dpkg configure … Done
  • update apt-get … Done
  • install python3-libcamera … Done
  • install python3-picamera2 … Done
  • install rpicam-apps … Done
  • install python3-pyqt5 … Done
  • install python3-opengl … Done
  • install python3-opencv … Done
  • install opencv-data … Done
  • install ffmpeg … Done
  • install libgtk-3-0 … Done
  • install libxcb-shm0 … Done
  • install libcdio-paranoia-dev … Done
  • install libsdl2-2.0-0 … Done
  • install libxv1 … Done
  • install libtheora0 … Done
  • install libva-drm2 … Done
  • install libva-x11-2 … Done
  • install libvdpau1 … Done
  • install libharfbuzz0b … Done
  • install libbluray2 … Done
  • install libzbar0 … Done
  • install libopenblas-dev … Done
    pip3 install dependency:
  • update pip3 … Done
  • install Flask … Error
  • install imutils … Error
  • install qrcode … Done
  • install pyzbar … Error
  • install pyzbar[scripts] … Error
  • install readchar … Error
  • install protobuf>=3.20.0 … Error
  • install numpy … Error
    mediapipe is not supported on this platform… Skip
    ai-edge-litert is not supported on this platform… Skip
    Create workspace
  • create dir … Done
  • copy workspace … Done

Error happened in install process:
pip3 install ./ error:
Status:1
Error:error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

install Flask error:
Status:1
Error:error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

install imutils error:
Status:1
Error:error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

install pyzbar error:
Status:1
Error:error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

install pyzbar[scripts] error:
Status:1
Error:error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

install readchar error:
Status:1
Error:error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

install protobuf>=3.20.0 error:
Status:1
Error:error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

install numpy error:
Status:1
Error:error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Try to fix it yourself, or contact service@sunfounder.com with this message

All in all I’m happy and grateful for the progress :slight_smile: I’ll send this off to Sunfounder as instructed

OK. You only really have a single but repeated error now. Id suggest looking up pip installation inside a venv. I could probably trace the source through given time, but sunfounder would be back in office before I’d have done it,

But, none of this should be necessary so I’d still seriously consider a new install on bookworm on a new sdcard. But, im halfway through a bottle of Malbec now, so not at my best decision making :wink:

1 Like

Well.. I encountered further errors when trying to run 0_calibration.py in the next step, this time about there not being a robot_hat module and I’m not surprised after all of my various attempts to this point, so I am currently reflashing with bookworm. Whatever happens, I will learn something :D.
Enjoy the Malbec, give my regards to your fellow Mercurians :wink:

The issue has been fixed. It was caused by the installation process requiring user input, and it got stuck waiting for that input. Just follow the steps below:

Reboot the Raspberry Pi.

Manually update python3-pip: sudo apt-get install -y python3-pip

If prompted for input, enter y and press Enter. Wait for the process to complete.

Update vilib and re-run the installation command:

cd ~/vilib
git pull origin main
sudo python3 install.py

2 Likes

Good morning and thanks for the update!
Just to bring any readers up to speed, I did end up installing Bookworm and did not encounter any installation issues with the modules whatsoever. I’ve been able to both calibrate PiDog as well as run some of the provided scripts. Thanks again @Spf650
What I will do now is pull out the card and do it again! With this new information from @SunFounder_Moderator I’m curious to see if the process will go as smoothly with Trixie.
Stay tuned

1 Like

The Trixie system is also compatible. If you encounter any issues, please feel free to ask.