[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: AttributeError: module 'socket' has no attribute 'timeout'



On 4/25/19 10:04 AM, Artem Golubev wrote:
Hello,  I’m using python3.5, python3.7 on Debian 9 stretch
This is my code:

[snip]


When I execute my code I receive this error

***************
Traceback (most recent call last):
   File "/root/python/projects/test/socket.py", line 7, in <module>
     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
AttributeError: module 'socket' has no attribute 'AF_INET'


Hi,

the problem is you've named your file 'socket', and that precedes the python module 'socket' when importing. Try renaming it.

Since your question is not specific to debian python packaging though, it would be probably better to ask elsewhere, e.g. https://stackoverflow.com/

Cheers


Reply to: