Open buckleyc opened 2 years ago
Try using an older version of Python. I'm seeing the same thing with python 3.9, but when I switched to 3.7 the errors went away... maybe use a virtual environment?
I'm seeing the same with python 3.8 and 3.9
I have recently been running python 3.10.6, and went to check this issue; this is still persisting.
╭─[zephyr] as buckley in ~ using node v18.9.0 19:48:07
╰──➤ /usr/local/bin/python3 -m pip install ipify
Collecting ipify
Using cached ipify-1.0.0-py2.py3-none-any.whl (8.9 kB)
Collecting backoff>=1.0.7
Using cached backoff-2.1.2-py3-none-any.whl (14 kB)
Requirement already satisfied: requests>=2.7.0 in /usr/local/lib/python3.10/site-packages (from ipify) (2.28.1)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/site-packages (from requests>=2.7.0->ipify) (2022.6.15)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/site-packages (from requests>=2.7.0->ipify) (1.26.10)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/site-packages (from requests>=2.7.0->ipify) (3.3)
Requirement already satisfied: charset-normalizer<3,>=2 in /usr/local/lib/python3.10/site-packages (from requests>=2.7.0->ipify) (2.1.0)
Installing collected packages: backoff, ipify
Successfully installed backoff-2.1.2 ipify-1.0.0
╭─[zephyr] as buckley in ~ using node v18.9.0 19:48:40
╰──➤ /usr/local/bin/python3
Python 3.10.6 (main, Aug 30 2022, 05:12:36) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ipify import get_ip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.10/site-packages/ipify/__init__.py", line 31, in <module>
from .ipify import get_ip
File "/usr/local/lib/python3.10/site-packages/ipify/ipify.py", line 14, in <module>
from .settings import API_URI, MAX_TRIES, USER_AGENT
File "/usr/local/lib/python3.10/site-packages/ipify/settings.py", line 9, in <module>
from platform import mac_ver, win32_ver, linux_distribution, system
ImportError: cannot import name 'linux_distribution' from 'platform' (/usr/local/Cellar/python@3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/platform.py)
>>>
you need to use less than 3.5 for using but a new pull request will solve it all (Platform.linux_distribution ) is depricated in python 3.5
Trying to use latest ipify-1.0.0 with python 3.10.2 on macOS 11.6.5. Returns "ImportError: cannot import name 'linux_distribution' from 'platform'"