OpenCv error can't open camera through video capture


Question I was using my cam through opencv and suddenly after restarting I ran my code it shows below error: [ WARN:0] global /io/opencv/modules/videoio/src/cap_v4l.cpp (802) open VIDEOIO ERROR: V4L: can't open camera by index 0 Traceback (most recent call last): File "test.py", line 20, in <module> retval, buffer_img = cv2.imencode('.jpg', frame) cv2.error: OpenCV(4.1.2) /io/opencv/modules/imgcodecs/src/loadsave.cpp:877: error: (-215:Assertion failed) !image.empty() in function 'imencode' cap = cv2.VideoCapture(0) # here it throws an error import json while(True): # Capture frame-by-frame ret, frame = cap.…
Read more ⟶

Installing Ruby 1.9.1 on Ubuntu?


Question I wonder about installing the latest version of Ruby on Ubuntu 9.04. Now I can run through the ./configure and make stuff fine, but what I wonder about: how to avoid conflicts with the packaging system? For example if some other package I install depends on Ruby, wouldn't the package manager install the (outdated) Ruby package and in the worst case overwrite my files? So I think I need some way to tell Ubuntu that Ruby is in fact already installed?…
Read more ⟶

How do I start cron on docker ubuntu base?


Question I have installed cron via apt-get install cron Trying to start cron fails (as expected) because of upstart not running. What is the command line for starting cron properly (i.e. it will read users' crontabs, will read /etc/crontab/* etc)? Please note that I do not want to start the container as a "full" machine, so I don't want to run /sbin/init or upstart. I manage the processes via supervisord, so what I 'm missing is the command line to add to its configuration file.…
Read more ⟶

How make mysql start automatically ? (linux-cli only)


Question How can i make mysql start every time the system boot ? I need that in a dedicated server(ubuntu distro) in which i have my blog, but every time the server goes down, on booting mysql is stopped. Btw i can use only command line. Answer update-rc.d allows setting init script links on Ubuntu and Debian Linux systems to control what services are run by init when entering various runlevels.…
Read more ⟶

Django runserver hangs at "System check identified no issues (0 silenced)."


Question On one Ubuntu box, the project runs just fine with python manage.py runserver. When trying to replicate it on another Ubuntu box, after installation, it hangs at System check identified no issues (0 silenced). with no further output. Answer Just came across the same issue - in my case it happened because the database server was down EDIT: Django version 1.9…
Read more ⟶

How do I install pip for python 3.8 on Ubuntu without changing any defaults?


Question I'm trying to install pip for Python 3.8 on an Ubuntu 18.04 LTS. I know this has been asked way too many times. But those questions do not concern keeping Ubuntu's defaults specifically. And the answers on those questions either don't work or go on to suggest something so drastic that it would break the system - e.g. change default python3 version from 3.6 to 3.8. You SHOULDN'T! So far, I've been able to install python3.…
Read more ⟶

Why can't I install python3.6-dev on Ubuntu 16.04?


Question I am trying to install it with this command: sudo apt-get install python3.6-dev But I'm getting this error: E: Unable to locate package python3.6-dev E: Couldn't find any package by glob 'python3.6-dev' E: Couldn't find any package by regex 'python3.6-dev' Why am I getting this error and what is the correct way to install the package? Answer The package is not available in 16.04. But if you need it in 16.…
Read more ⟶