Python Forum
how to get your own ip using python (NO SOCKET:) ) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: how to get your own ip using python (NO SOCKET:) ) (/thread-24748.html)



how to get your own ip using python (NO SOCKET:) ) - julio2000 - Mar-02-2020

Hi,
I would like to create a code wich symply prints out the IP of the user running the code. I can't use socket cause socket creates an error when turning my program into an .exe. Does someone know a other way to get the IP?

thanks in advance!


RE: how to get your own ip using python (NO SOCKET:) ) - buran - Mar-02-2020

it would be better to tell how you try to convert your program to exe and what error you get
and of course show your code in python tags.
Probably the problem with the created exe is not the socket module


RE: how to get your own ip using python (NO SOCKET:) ) - julio2000 - Mar-02-2020

Well it is:(. It keeps on giving the error:
import socks
ModuleNotFoundError: 'No module named 'socks'

In my script I've clearly written Import socket, not import socks.


RE: how to get your own ip using python (NO SOCKET:) ) - buran - Mar-02-2020

well, if it says socks that is how it is written in the code you run :-) it's not something the interpreter will lie about... :-)

show your code is python tags, the full traceback - in error tags
if you did correct the code - make sure you save after changes, make sure you run the code you *think* running

and how this is related with the exe? this error will come even hen you run the script as py file