Python Syntax Errors in Motorized Focus Camera scripts
Published by peroberts on
New Home › Forums › 1. Cameras Modules for Raspberry Pi › 5MP OV5647 V1 Cameras › Python Syntax Errors in Motorized Focus Camera scripts
- This topic has 3 replies, 2 voices, and was last updated 1 year, 1 month ago by
bin.
- AuthorPosts
- December 18, 2019 at 5:53 pm #14268
peroberts
ParticipantI downloaded the 3 scripts from github today, extracted them, and ran them in the command line, and this is the result:
[email protected]:~ $ sudo python Motorized_Focus_Camera_Preview.py
File “Motorized_Focus_Camera_Preview.py”, line 16
if event.type ==KEYDOWN:
^
TabError: inconsistent use of tabs and spaces in indentation[email protected]:~ $ sudo python Autofocus.py
Traceback (most recent call last):
File “Autofocus.py”, line 1, in <module>
import cv2 #sudo apt-get install python-opencv
ModuleNotFoundError: No module named ‘cv2’[email protected]:~ $ sudo python Motorized_Focus_Camera_Snapshot.py
File “Motorized_Focus_Camera_Snapshot.py”, line 18
if event.type ==KEYDOWN:
^
TabError: inconsistent use of tabs and spaces in indentation
[email protected]:~ $Can you help me out here? Thanks.
-Penny
- December 19, 2019 at 10:53 pm #14326
bin
KeymasterHi,
The python code need pygame module, which is not convenient. I have add a C version code just now. Please try to use the new code https://github.com/ArduCAM/RaspberryPi/tree/master/Motorized_Focus_Camera/C
- December 20, 2019 at 12:36 am #14335
peroberts
ParticipantThis works perfectly. Thanks!
- AuthorPosts
- You must be logged in to reply to this topic.