Path: csiph.com!aioe.org!bofh.it!news.nic.it!robomod From: Alexandros Afentoulis Newsgroups: linux.debian.maint.python Subject: Re: AttributeError: module 'socket' has no attribute 'timeout' Date: Thu, 25 Apr 2019 10:20:01 +0200 Message-ID: References: X-Mailbox-Line: From debian-python-request@lists.debian.org Thu Apr 25 08:18:43 2019 Old-Return-Path: X-Amavis-Spam-Status: No, score=-7 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate: -4.6 X-Greylist: delayed 642 seconds by postgrey-1.36 at bendel; Thu, 25 Apr 2019 08:18:31 UTC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Authentication-Results: ORIGINATING; auth=pass smtp.auth=alexaf@bloom.re smtp.mailfrom=alexaf@bloom.re X-Mailing-List: archive/latest/16893 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/eaef9e87-bffd-efad-cd0e-dae92ef444b5@bloom.re Approved: robomod@news.nic.it Lines: 26 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Thu, 25 Apr 2019 11:07:45 +0300 X-Original-Message-ID: X-Original-References: Xref: csiph.com linux.debian.maint.python:11419 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 >     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