shivasiddharth / GassistPi

Google Assistant for Single Board Computers
Other
1.02k stars 304 forks source link

not importing cv2 library while using custome script feeature #1158

Closed ganeshArwat closed 2 years ago

ganeshArwat commented 2 years ago

IMPORTANT NOTICE
If you do not complete the template below it is likely that your issue will not be addressed. When providing information about your issue please be as extensive as possible so that it can be solved by as little as possible responses.

FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED

Which branch of GassistPi are you using ?

Board and OS details:

Open a terminal and run

cat /proc/cpuinfo  
cat /etc/os-release  
cat /etc/rpi-issue
processor   : 0
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 1
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 2
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

processor   : 3
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

Hardware    : BCM2711
Revision    : c03111
Serial      : 10000000a7f44295
Model       : Raspberry Pi 4 Model B Rev 1.1

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Raspberry Pi reference 2022-01-28
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f01430c9d8f67a4b9719cc00e74a2079d3834d5d, stage5

Describe the bug:

when i am trying to run my script through the custom script run feature it was not import the cv2 library

Did you go through or search the issues section to check if your issue was already discussed (either currently open issues or closed issues)?

Yes

2. Is the issue related to assistant installation ?

No

If answer to question 2 is Yes, then attach the contents of terminal as a file or paste it below.

If answer to question 2 is No, then proceed further.

3. Does the assistant service start normally?

Yes

4. Is the assistant service restarting automatically?

No

If answer to question 4 is Yes, then paste the contents of the terminal below.

If answer to question 4 is No, then proceed further.

Manually start the assistant. For guidelines to start the assistant manually refer this

Paste the command below, that crashed the assistant

Paste the contents of the terminal below

ON_RECOGNIZING_SPEECH_FINISHED:
  {"text": "Run script object"}

python -u "/home/pi/1.object detection/d1/Object_Detection_Files/nms_main.py"
Traceback (most recent call last):
  File "/home/pi/1.object detection/d1/Object_Detection_Files/nms_main.py", line 1, in <module>
    import cv2
ImportError: No module named cv2
ON_RESPONDING_STARTED:
  {"is_error_response": false}

ON_RESPONDING_FINISHED

ON_CONVERSATION_TURN_FINISHED:
  {"with_follow_on_turn": false}
ganeshArwat commented 2 years ago

it is not just for cv2 but also for other libraries

ganeshArwat commented 2 years ago

when i run this script directly through the terminal it will run smothly

shivasiddharth commented 2 years ago

This is not an issue with the program, its an issue with the implementation of your script. Last time itself I had indicated you to use Gitter for help outside the scope of this project. And why was this #1157 opened and immediately closed ?

The modules are not being detected because they are not within the environment. To install modules within the environment, do: source env/bin/activate and then install the modules.

ganeshArwat commented 2 years ago

The modules are not being detected because they are not within the environment. To install modules within the environment, do: source env/bin/activate and then install the modules.

after doing these also getting problem

shivasiddharth commented 2 years ago

Ping me in Gitter.

ganeshArwat commented 2 years ago

Allready pinged