cdchris12 / UDM-DNS-Fix

A simple script to provide basic DHCP hostname resolution in the latest UniFi Dream Machine Pro firmware.
Apache License 2.0
74 stars 8 forks source link

'import: command not found' errors #6

Closed townsmcp closed 2 years ago

townsmcp commented 2 years ago

Hey. I'm looking for a bit of help. My setup is:

However when I run ./get_unifi_reservations.py -b https://192.168.1.1:443 -p <pass> -u <user> -su root -sp <ssh_password> -sa 192.168.1.1 -f -vvv or bash get_unifi_reservations.py -b https://192.168.1.1:443 -p <pass> -u <user> -su root -sp <ssh_password> -sa 192.168.1.1 -f -vvv I get the following output:

get_unifi_reservations.py: line 3: import: command not found
get_unifi_reservations.py: line 4: import: command not found
get_unifi_reservations.py: line 5: import: command not found
from: can't read /var/mail/argparse
get_unifi_reservations.py: line 9: import: command not found
get_unifi_reservations.py: line 10: import: command not found
from: can't read /var/mail/scp
get_unifi_reservations.py: line 14: import: command not found
get_unifi_reservations.py: line 15: syntax error near unexpected token `urllib3.exceptions.InsecureRequestWarning'
get_unifi_reservations.py: line 15: `urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)'

Any ideas on how to get this working? I also get the same message when running ./get_unifi_reservations.py -h or bash get_unifi_reservations.py -h Thanks in advance

cdchris12 commented 2 years ago

This looks like an issue with your python interpreter installation. Can you run the following commands and let me know the output?

which python3
python3 --version

Also, which OS are you running this on? Linux, OSX, or Windows?

townsmcp commented 2 years ago

@cdchris12 when I run which python3 I get the following:

/usr/bin/python3

When running python3 --version I get:

Python 3.8.10

This is on Ubuntu 20.04.3 LTS (Linux)

cdchris12 commented 2 years ago

Interesting; that looks correct... Can you try launching the script via this command and let me know if that works for you?

python3 get_unifi_reservations.py -b https://192.168.1.1:443 -p <pass> -u <user> -su root -sp <ssh_password> -sa 192.168.1.1 -f -vvv

If that doesn't work for you, can you also send me the output from this command as well?

pip freeze
townsmcp commented 2 years ago

@cdchris12 the python3 command worked