Skip to content

Commit 32879ee

Browse files
Merge pull request #937 from luxonis/fix/demo_deps
Pin dependencies for demo
2 parents d683bc0 + 334da34 commit 32879ee

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

depthai_demo.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import signal
44
import sys
55

6-
from depthai_sdk.fps import FPSHandler
7-
from depthai_sdk.previews import Previews
8-
96
if sys.version_info[0] < 3:
107
raise Exception("Must be using Python 3")
118
import argparse
@@ -30,6 +27,8 @@
3027
import numpy as np
3128
from depthai_sdk.managers import ArgsManager, getMonoResolution, getRgbResolution
3229
from depthai_helpers.app_manager import App
30+
from depthai_sdk.fps import FPSHandler
31+
from depthai_sdk.previews import Previews
3332
except Exception as ex:
3433
print("Third party libraries failed to import: {}".format(ex))
3534
print("Run \"python3 install_requirements.py\" to install dependencies")

depthai_helpers/version_check.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
import depthai
24
from pathlib import Path
35

@@ -9,7 +11,11 @@ def getVersionFromRequirements(package_name, req_path):
911
#not commented out and has version indicator (==)
1012
if not line.startswith('#') and '==' in line:
1113
try:
12-
version = line.split('==')[1]
14+
split = line.split('==')
15+
name = split[0]
16+
if name != package_name:
17+
continue
18+
version = split[1]
1319
version = version.split(';')[0]
1420
#remove any whitespace
1521
version = version.strip()
@@ -46,7 +52,17 @@ def checkRequirementsVersion():
4652
daiVersionRequired = getVersionFromRequirements('depthai', Path(__file__).parent / Path('../requirements.txt'))
4753
if daiVersionRequired is not None:
4854
if daiVersionRequired != getVersion('depthai'):
49-
raise SystemExit(f"\033[1;5;31mVersion mismatch\033[0m\033[91m between installed depthai lib and the required one by the script.\033[0m \n\
55+
print(f"\033[1;5;31mVersion mismatch\033[0m\033[91m between installed depthai lib and the required one by the script.\033[0m \n\
5056
Required: {daiVersionRequired}\n\
5157
Installed: {getVersion('depthai')}\n\
5258
\033[91mRun: python3 install_requirements.py \033[0m")
59+
sys.exit(42)
60+
61+
daiSdkVersionRequired = getVersionFromRequirements('depthai-sdk', Path(__file__).parent / Path('../requirements.txt'))
62+
if daiSdkVersionRequired is not None:
63+
if daiSdkVersionRequired != getVersion('depthai-sdk'):
64+
print(f"\033[1;5;31mVersion mismatch\033[0m\033[91m between installed depthai-sdk lib and the required one by the script.\033[0m \n\
65+
Required: {daiSdkVersionRequired}\n\
66+
Installed: {getVersion('depthai_sdk')}\n\
67+
\033[91mRun: python3 install_requirements.py \033[0m")
68+
sys.exit(42)

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ requests==2.26.0
22
--extra-index-url https://www.piwheels.org/simple
33
numpy>=1.21.4 # For RPi Buster (last successful build) and macOS M1 (first build). But allow for higher versions, to support Python3.11 (not available in 1.21.4 yet)
44
opencv-contrib-python==4.5.5.62 # Last successful RPi build, also covers M1 with above pinned numpy (otherwise 4.6.0.62 would be required, but that has a bug with charuco boards). Python version not important, abi3 wheels
5-
depthai-sdk
5+
depthai-sdk==1.9.4
66
--extra-index-url https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/wheels/
77
pyqt5>5,<5.15.6 ; platform_machine != "armv6l" and platform_machine != "armv7l" and platform_machine != "aarch64" and platform_machine != "arm64"
88
--extra-index-url https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/
9-
depthai>=2.20.1.0
9+
depthai==2.20.2.0
1010
Qt.py

0 commit comments

Comments
 (0)