Skip to content

Commit

Permalink
Except ImportError when not packaged
Browse files Browse the repository at this point in the history
  • Loading branch information
ppfeister committed Jul 1, 2024
1 parent 501cb3d commit d330136
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@
networks.
"""

import sys

# Many users are running Sherlock with `python3 sherlock/sherlock.py ...` and opening bug reports when they get ImportErrors.
# This is a temporary(ish) notification to users who do so.
try:
from sherlock.__init__ import ( # noqa: E402
__longname__,
__version__
)
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.")
print("Most users can simply run `pipx install sherlock-project`, but other options are detailed on that website.")
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

Expand All @@ -24,11 +38,6 @@
__version__ = "0.14.4"
del __version__

from .__init__ import ( # noqa: E402
__longname__,
__version__
)

from requests_futures.sessions import FuturesSession # noqa: E402
from torrequest import TorRequest # noqa: E402
from sherlock.result import QueryStatus # noqa: E402
Expand Down

0 comments on commit d330136

Please # to comment.