"import socket" error

A

akbarhome

Hi,

I am following this tutorial
https://www14.software.ibm.com/weba...=105AGX59&S_CMP=GR&ca=dgr-lnxw07PythonSockets
( free reg. req. )

The article told me to do this:

[camus]$ python
Python 2.4 (#1, Feb 20 2005, 11:25:45)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
When I try it, I get this error:Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/socket.py", line 1, in ?
# Wrapper module for _socket, providing some additional facilities
File "/usr/lib/python2.4/SocketServer.py", line 274, in ?
class TCPServer(BaseServer):
File "/usr/lib/python2.4/SocketServer.py", line 317, in TCPServer
address_family = socket.AF_INET
AttributeError: 'module' object has no attribute 'AF_INET'

Why? Thank you.
 
F

Fredrik Lundh

I am following this tutorial
https://www14.software.ibm.com/weba...=105AGX59&S_CMP=GR&ca=dgr-lnxw07PythonSockets
( free reg. req. )

The article told me to do this:

[camus]$ python
Python 2.4 (#1, Feb 20 2005, 11:25:45)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
When I try it, I get this error:Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/socket.py", line 1, in ?
# Wrapper module for _socket, providing some additional facilities
File "/usr/lib/python2.4/SocketServer.py", line 274, in ?
class TCPServer(BaseServer):
File "/usr/lib/python2.4/SocketServer.py", line 317, in TCPServer
address_family = socket.AF_INET
AttributeError: 'module' object has no attribute 'AF_INET'
Why? Thank you.

your Python installation is broken. what OS are you using?

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top