Installing gtk2.0 on raspberry Pi - opencv

I am quite new or Rasperry Pi and am working on an object detection project that I found online. I am having an issue when trying to install gtk2.0 on the PI. Its like the repo simply wont download for me.
I have tried
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libgtk2.0-dev libgtk-3-dev
sudo apt-get install libgtk2.0-dev
When trying to install the package it is able to retrieve the information about the package but not able to install it as seen in the screenshots below.
I have tried both Bullseye and Buster os for the PI and still the same issue.
I have installed gtk3.0 but still faces with the same issue if I try and run the final code.
also have tried downloading the package on multiple different networks and its still the same
Any help would you be greatly appreciated as I really am losing hope for this project
The project guide I am following ishttps://core-electronics.com.au/guides/object-identify-raspberry-pi/

Related

Raspberry PI 4 - 8GM RAM - 64 bit OS aarch64 - easyocr - torch - opencv - illegal instruction

I am trying to get easyocr running on a raspberry pi 4 and could use some suggestions or help. I am using the 64 bit build from May 7th - 2021 (2021-05-07-raspios-buster-arm64.zip). When I do a fresh OS install, I execute the following commands:
sudo vi /etc/dphys-swapfile # change swapfile to 2GB
sudo raspi-config # expand the filesystem to use the entire SD card
sudo apt-get update #
sudo apt-get upgrade #
sudo apt autoremove # The following packages will be REMOVED: python-colorzero
sudo python -m pip install --upgrade pip # upgrade pip
sudo pip3 install --upgrade pip # upgrade pip3
sudo python3 -m pip install numpy --upgrade # upgrade numpy
sudo python3 -m pip install easyocr # install easyocr
I open a python3 editor and execute the following commands:
import cv2
import torch
import easyocr
reader = easyocr.Reader(['en'])
results = reader.readtext('/home/pi/Downloads/Calibration.bmp')
The last command results in an Illegal instruction error. I figured openCV was the likely culprit so I compiled it from source and tried again. I got the same error. I have tried going with a 32 bit build, but torch needs 64 bit to work. I have tried the same sequence and code through Anaconda on a windows 64 bit machine and it works without issue.
My next two attempts will be to build easyocr and/or torch from source , but I am grasping at straws here. I am really not sure how to figure out what software is causing the illegal instruction so I can hone in on that package. I would appreciate any thoughts on what I can do to get more information or thoughts on what things I can try.
Thanks a bunch.
[EDIT]I installed python3-dbg so I could run the application under gdb. When I do, the error I get is
Thread 1 "python3-dbg" received signal SIGILL, Illegal instruction. 0x0000ffffe4189fc8 in exec_blas () from
/home/[USER]/.local/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so
[EDIT2]I found a git hub repository that creates wheel files (WHL) for those having illegal instruction errors like me. So far it hasn't helped. I have tried a few, but am going to use a more systematic approach. to see if I can find the right combination.

Unmet dependencies when installing libboost-all-dev on i386/debian Docker image

I want to dockerize a build environment for Linux i386 targets. I need to install library dependencies such as boost. But I came across this error:
Dockerfile
FROM i386/debian:sid
RUN apt-get update
RUN apt-get -y install libboost1.67-all-dev
But even this simple script failed:
The following packages have unmet dependencies:
libboost1.67-all-dev : Depends: libboost-mpi1.67-dev but it is not going to be installed
Depends: libboost-mpi-python1.67-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I changed to libboost1.67-dev and it worked. I'm not sure what's the difference. If someone knows please explain that to me.
In a similar situation, I found two solutions:
opt.1) sudo apt install <unmet dependencies and sub-dependencies>
this is not straightforward but it should work
opt.2) give up all-dev and install only required packages which may be like
sudo apt install build-essential:i386 libboost-system-dev:i386 libboost-thread-dev:i386 libboost-program-options-dev:i386 libboost-test-dev:i386

Is there any RasPi image with integrated OpenCV libraries, to avoid compilation task of OpenCV?

There are number of tutorials online which can tell you how to setup openCV on RasPi. But the process itself is time consuming as it involves compilation of all modules.
So, i am hoping that there must be someone maintaining the RasPi images with openCV libraries integrated.
I found the solution i was looking for. I wanted to avoid compilation task for opencv libraries, as on RasPi it take like 9-11 hours. Looking over internet regarding installing opencv on Raspi, everybody was directing towards compilation steps.
OpenCV installation easy way, here i finally found the instruction, to install opencv libraries directly. Then i tried a simple example of reading an image using OpenCV, everything was working smooth.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libcv-dev
sudo apt-get install python-opencv
sudo apt-get install libopencv-dev
sudo apt-get install libcv2.3
sudo apt-get install opencv-doc
I hope it may help someone, as i spent quite a time looking for this.

erlang is no longer supported by Red Hat Enterprise Linux?

I'm trying installing Erlang on my REHL7.2, but unfortunately I failed. I tried two approaches
First I tried downloading a RPM package from official site of erlang (in fact the rpm package is for CentOS, but there's no RPM package for RHEL anyway), but
error: Failed dependencies:
libwx_baseu-2.8.so.0()(64bit) is needed by esl-erlang-19.0-1.x86_64
libwx_baseu-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-19.0-1.x86_64
Then I tried
$ wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
$ rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
But it failed too because
No package erlang available.
Error: Nothing to do
I wonder whether Erlang is no longer supported by RHEL? Otherwise how can I install Erlang on my RHEL7.2?
One simple solution to install the Erlang Solutions package is install the epel repository:
yum install epel-release
Then
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
sudo yum install erlang
The epel repo contains the libwx_* libraries required.
As instructed here:
enter link description here
Run the following commands (note: the commands on the above link use R15B01, but in the following commands, I changed it to the last release of Erlang (R15B03) It will take a while to finish with the installation. Run commands line by line
sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
wget http://erlang.org/download/otp_src_R15B03.tar.gz
tar zxvf otp_src_R15B03.tar.gz
cd otp_src_R15B03
./configure && make && sudo make install
After everything is done, you will be still at otp_src_R15B03 where Erlang is installed. Type erl and Enter, then, it should run and open Erlang prompt. I tried running Erlang from my home directory and from the root by just typing erl and it worked too. This way, Erlang is working good for me. To quit Erlang press CTRL + g then q and Enter
There is another way to install and useful info on this link:
enter link description here
I have figured it out! I found two solutions.
The first solution which is also the easiest way is to install a zero dependency version of erlang, please refer to my another Question. But I only tried this way after installing erlang from source, so if you failed this way, just try the following soltuion.
The other one is to build erlang from source (or by kerl which is essentially the same thing).
Install necessary dependencies:$sudo yum install ncurses-devel openssl-devel *openjdk-devel unixODBC unixODBC-devel
Download source code of erlang, unzip it and cd into the direcotry
sudo ./configure sudo make sudo make install
Please refer to this article.
Thank you everyone!
Try this, worked for me.
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum install erlang erlang-nox

Xvfb not found on your system

I try to use Xvfb to make the headless code run. However, I encountered the problem that "Xvfb not found on your system" when I tried to run my ruby code. Then I tried to install Xvfb using
sudo apt-get install xvfb
However, "apt-get: command not found" is showed. Thus, I have not idea what should be installed to avoid the original Xvfb error. Any helps? Thank you.
Old question, but found it will trying to find the apt-get commands. The command not found is likely because you are not on a debian system. So you should probably be using yum.
Some potentially useful links:
https://serverfault.com/questions/344793/install-xvfb-via-yum-yum-repository-for-xvfb
How to install Xvfb (X virtual framebuffer) on Redhat 6.5?
In CentOS 7, the following command will install it:
$ sudo yum install xorg-x11-server-Xvfb

Resources