handle of ModuleNotFoundError

This commit is contained in:
spla 2022-08-03 09:10:20 +02:00
parent 700ad081b4
commit 67e239ebad
2 changed files with 8 additions and 2 deletions

View file

@ -8,7 +8,10 @@ import os
import sys
import os.path
import psycopg2
from prettytable import PrettyTable
try:
from prettytable import PrettyTable
except ModuleNotFoundError as mod_not_found:
print(f"{mod_not_found}. Run 'pip install -r requirements.txt' and try again")
def get_user(email):

View file

@ -2,7 +2,10 @@ import os
import sys
from datetime import datetime, timezone, timedelta
import time
import psycopg2
try:
import psycopg2
except ModuleNotFoundError as mod_not_found:
print(f"{mod_not_found}'. Run 'pip install -r requirements.txt' and try again")
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib