Skip to content

Commit a1b889b

Browse files
author
SzabolcsGergely
committed
Change to sys.executable from python3 to make sure the suggested requirements are for the current interpreter
1 parent 2d1e307 commit a1b889b

14 files changed

+28
-14
lines changed

examples/08_rgb_mobilenet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
args = parser.parse_args()
1515

1616
if not Path(nnPathDefault).exists():
17-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
17+
import sys
18+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
1819

1920
# Start defining a pipeline
2021
pipeline = dai.Pipeline()

examples/09_mono_mobilenet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
nnPath = sys.argv[1]
1313

1414
if not Path(nnPath).exists():
15-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
15+
import sys
16+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
1617

1718
# Start defining a pipeline
1819
pipeline = dai.Pipeline()

examples/10_mono_depth_mobilenetssd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
nnPath = sys.argv[1]
1313

1414
if not Path(nnPath).exists():
15-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
15+
import sys
16+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
1617

1718
# Start defining a pipeline
1819
pipeline = dai.Pipeline()

examples/11_rgb_encoding_mono_mobilenet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
nnPath = sys.argv[1]
1313

1414
if not Path(nnPath).exists():
15-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
15+
import sys
16+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
1617

1718
pipeline = dai.Pipeline()
1819

examples/12_rgb_encoding_mono_mobilenet_depth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
nnPath = sys.argv[1]
1313

1414
if not Path(nnPath).exists():
15-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
15+
import sys
16+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
1617

1718
pipeline = dai.Pipeline()
1819

examples/15_rgb_mobilenet_4k.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
nnPath = sys.argv[1]
1313

1414
if not Path(nnPath).exists():
15-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
15+
import sys
16+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
1617

1718
# Start defining a pipeline
1819
pipeline = dai.Pipeline()

examples/17_video_mobilenet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
videoPath = sys.argv[2]
1717

1818
if not Path(nnPath).exists() or not Path(videoPath).exists():
19-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
19+
import sys
20+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
2021

2122
# Start defining a pipeline
2223
pipeline = dai.Pipeline()

examples/18_rgb_encoding_mobilenet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
nnPath = sys.argv[1]
1313

1414
if not Path(nnPath).exists():
15-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
15+
import sys
16+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
1617

1718
pipeline = dai.Pipeline()
1819

examples/22_1_tiny_yolo_v3_device_side_decoding.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
nnPath = sys.argv[1]
4040

4141
if not Path(nnPath).exists():
42-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
42+
import sys
43+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
4344

4445
# Start defining a pipeline
4546
pipeline = dai.Pipeline()

examples/22_2_tiny_yolo_v4_device_side_decoding.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
nnPath = sys.argv[1]
3939

4040
if not Path(nnPath).exists():
41-
raise FileNotFoundError("Required file/s not found, please run 'python3 install_requirements.py'")
41+
import sys
42+
raise FileNotFoundError(f'Required file/s not found, please run "{sys.executable} install_requirements.py"')
4243

4344
# Start defining a pipeline
4445
pipeline = dai.Pipeline()

0 commit comments

Comments
 (0)