diff --git a/sherlock_project/__init__.py b/sherlock_project/__init__.py index 5bf79e24..91f8f66e 100644 --- a/sherlock_project/__init__.py +++ b/sherlock_project/__init__.py @@ -5,6 +5,9 @@ networks. """ +# This variable is only used to check for ImportErrors induced by users running as script rather than as module or package +import_error_test_var = None + __shortname__ = "Sherlock" __longname__ = "Sherlock: Find Usernames Across Social Networks" __version__ = "0.14.4" diff --git a/sherlock_project/sherlock.py b/sherlock_project/sherlock.py index 4497d44b..81080765 100644 --- a/sherlock_project/sherlock.py +++ b/sherlock_project/sherlock.py @@ -7,12 +7,20 @@ This module contains the main logic to search for usernames at social networks. """ +import sys + +try: + from sherlock.__init__ import import_error_test_var # noqa: F401 +except ImportError: + print("Did you run Sherlock with `python3 sherlock/sherlock.py ...`?") + print("This is an outdated method. Please see https://sherlockproject.xyz/installation for up to date instructions.") + sys.exit(1) + import csv import signal import pandas as pd import os import re -import sys from argparse import ArgumentParser, RawDescriptionHelpFormatter from time import monotonic