Ich habe das Paket stun installiert
C:\py>python -m pip install stun
Collecting stun
Downloading stun-0.2.3.tar.gz (19 kB)
Preparing metadata (setup.py) ... done
Collecting udp>=0.4.9 (from stun)
Downloading udp-2.2.2-py3-none-any.whl.metadata (1.7 kB)
Collecting startrek>=2.2.2 (from udp>=0.4.9->stun)
Downloading startrek-2.2.2-py3-none-any.whl.metadata (5.6 kB)
Downloading udp-2.2.2-py3-none-any.whl (40 kB)
Downloading startrek-2.2.2-py3-none-any.whl (67 kB)
Building wheels for collected packages: stun
Building wheel for stun (setup.py) ... done
Created wheel for stun: filename=stun-0.2.3-py3-none-any.whl size=37838 sha256=6e52c8940cf12feb43efe1fee20e8c4f00a2b74191ca7ddfe58e220966e165d9
Stored in directory: c:\users\admin\appdata\local\pip\cache\wheels\1b\90\77\6d991e0a416e28e6a96cfcc94b04247a354864bb0a39499c77
Successfully built stun
Installing collected packages: startrek, udp, stun
Successfully installed startrek-2.2.2 stun-0.2.3 udp-2.2.2
[notice] A new release of pip is available: 24.3.1 -> 25.1.1
[notice] To update, run: python.exe -m pip install --upgrade pip
und dieses Script
import stun
nat_type, external_ip, external_port = stun.get_ip_info()
print("NAT-Typ:", nat_type)
print("Öffentliche IP:", external_ip)
print("Öffentlicher Port:", external_port)
Aber wenn ich es ausführe sagt Python das die Funktion get_ip_info() nicht gefunden wird.
C:\py>python app.py
Traceback (most recent call last):
File "C:\py\app.py", line 3, in <module>
nat_type, external_ip, external_port = stun.get_ip_info()
^^^^^^^^^^^^^^^^
AttributeError: module 'stun' has no attribute 'get_ip_info'
Wieso findet es die Funktion nicht?