0

I have a python code for attendance system which I'm trying to run in raspberry pi. I'm using python 3.9.2 and have installed all the required libraries through terminal. The code runs fine in Thonny but when I try to run the same code in terminal I'm getting the following error:

Traceback (most recent call last):
  File "/home/pi/Desktop/pa.py", line 1, in <module>
    import shutils
ModuleNotFoundError: No module named 'shutils'

I thought it's an issue with just shutils library but it's not. I'm getting the same error for all the libraries except one. These are the libraries I'm using:

import shutils
import pygame
import imutils
import cv2
import numpy as np
import face_recognition
import os
from datetime import datetime
import requests
import pysqlite3
import mysql.connector

Here pygame library has no issue in running through terminal as it showed the following after commenting 1st line:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

but all other libraries are showing the same error as mentioned above.

Please help me to find a solution for this, Thanks in advance.

1 Answer 1

0

Install shutils using pip3 (package manager for Python3):

pip3 install shutils

Run your code from a terminal window using (use 'python3' to make sure you are using Python3) :

python3 test.py

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.