Skip to content

Commit

Permalink
Update arducam_displayer.py
Browse files Browse the repository at this point in the history
Added detection of dependent libraries.
  • Loading branch information
edward-ardu authored and ArduCAM committed Feb 13, 2023
1 parent c876d6c commit 51912c1
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions Jetson/Jetvariety/example/arducam_displayer.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
import cv2
try:
import cv2
except ImportError:
print("Start to install opencv...")
os.system(f'sudo apt-get update')
os.system(f'sudo apt install nvidia-opencv-dev')
import numpy as np
from datetime import datetime
import array
import fcntl
import os
import argparse
from utils import ArducamUtils
try:
from utils import ArducamUtils
except ImportError as e:
import sys

print(e)
print("Start to install python environment...")

if sys.version[0] == 2:
print("Try to install python-pip...")
os.system(f'sudo apt install python-pip')
if sys.version[0] == 3:
print("Try to install python3-pip...")
os.system(f'sudo apt install python3-pip')

try:
from pip import main as pipmain
except ImportError:
from pip._internal import main as pipmain

print("Try to install jetson-stats...")
pipmain(['install', 'jetson-stats'])

print("Try to install v4l2-fix...")
pipmain(['install', 'v4l2-fix'])

from utils import ArducamUtils
import time
import sys

Expand Down

0 comments on commit 51912c1

Please sign in to comment.