Another thing that should be noted, if I try to run the program in either pycharm or vscode I get an error saying module not found.
With that said, if I run the script from the terminal it will run as long as I only search for one IP address, rather than a range, as stated above. I have also tried with python3 in the shebang as well as just python. I have also run the script with python as well as python3. The script always works as long as I am not scanning a range.