Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

Changed python to python3 for compatibility #49

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Morpheus0x
Copy link

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.

@zaanposni
Copy link
Contributor

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!

@Morpheus0x
Copy link
Author

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...

@LINKIWI
Copy link
Owner

LINKIWI commented May 17, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants