cloudflare-ddns-client
cloudflare-ddns-client copied to clipboard
Changed python to python3 for compatibility
The script didn't work out of the box since I had python2.7 and python3 installed. For systems with both installed, the python executable is version 2.7. Therefore the change to python3 is needed.
The script works in python2 so using python
instead of python3
lets the machine decide which installation it should use.
Your approach would crash on a machine with only py2 installed!
Running python2.7 cloudflare-ddns
i get this error, with all required packages installed from requirements.txt
Traceback (most recent call last):
File "cloudflare-ddns", line 10, in <module>
from tld import get_fld
File "/usr/local/lib/python2.7/dist-packages/tld/__init__.py", line 7, in <module>
from .utils import get_fld, get_tld, get_tld_names, is_tld, parse_tld, Result, update_tld_names
File "/usr/local/lib/python2.7/dist-packages/tld/utils.py", line 10, in <module>
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache
python3 cloudflare-ddns
works...
To the best of my knowledge the script should be backwards-compatible with Python 2 and we deliberately defer to your distro's choice of Python to choose one to use.
For the import error, I found some solutions by searching Google. Try pip install --upgrade backports.functools_lru_cache
or similar.