omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Socket inet_pton() is not included

    Pythonista
    socket inetpton
    2
    3
    2656
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bar4mi
      bar4mi last edited by bar4mi

      First of all, I'm not good at Pythonista. I moved netaddr module to site-packages-2 after downloading it using pipista. When I import netaddr, I get an Error below. I found the default socket.py module has no inet_pton(). I'm wondering why socket.py has no inet_pton and how to solve this problem. I need your advice.

      from socket import inet_pton as _inet_pton, AF_INET
      ImportError: cannot import name inet_pton

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by dgelessus

        FWIW, under Python 3 socket.inet_pton and socket.inet_ntop exist. Under Python 2 they don't for some reason.

        The netaddr library seems to be compatible with Python 2 and 3, so maybe you can get it to work under Python 3.

        1 Reply Last reply Reply Quote 0
        • bar4mi
          bar4mi last edited by bar4mi

          Thank you for your kind reply. As your information, it's just time for me to migrate to Python 3.x.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors