<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Re:AttributeError: module 'socket' has no attribut... in Intel® Distribution for Python*</title>
    <link>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1256539#M1636</link>
    <description>&lt;P&gt;Hi Louie,&lt;/P&gt;
&lt;P&gt;Thanks for continuing to track this issue.&lt;/P&gt;
&lt;P&gt;SO_REUSEADDR does work for me in some scenarios, but the as a solution it isn't great and &lt;A href="https://stackoverflow.com/questions/14388706/how-do-so-reuseaddr-and-so-reuseport-differ?rq=1" target="_self"&gt;isn't quite the same&lt;/A&gt;. Although my example was a simple socket.socket() example, I'm mostly losing asyncio, and if you look at:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.create_datagram_endpoint" target="_blank" rel="noopener"&gt;asyncio.loop.create_datagram_endpoint&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you'll see that SO_REUSEADDR is recommended against due to security concerns and is explicitly blocked in 3.8.1 for that reason. They say you should only use SO_REUSEPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did find a hack workaround:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import socket
if not hasattr(socket, 'SO_REUSEPORT'):
    socket.SO_REUSEPORT = 15&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In all the systems I use, SO_REUSEPORT is 15, so this works for me, but it's really not good to do something like this so&lt;EM&gt;&lt;STRONG&gt; I'm very thankful you are still tracking this issue.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As best I can tell this is compile-time issue for Python where it gets the value from the Linux socket C library, so the Intel Engineering Team must be compiling the Python in some way that doesn't get this from the underlying Linux socket interface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please keep me updated as new releases become available.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Feb 2021 20:36:17 GMT</pubDate>
    <dc:creator>jerry7</dc:creator>
    <dc:date>2021-02-16T20:36:17Z</dc:date>
    <item>
      <title>AttributeError: module 'socket' has no attribute 'SO_REUSEPORT'</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1198400#M1503</link>
      <description>&lt;P&gt;Both the 2020.1 and 2020.2 release give me an error when I use SO_REUSEPORT:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$ python3 --version
Python 3.7.7 :: Intel(R) Corporation

$ ipython3
Python 3.7.7 (default, Jun 26 2020, 05:10:03) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.17.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import socket

In [2]: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)

In [3]: s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, True) 
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
&amp;lt;ipython-input-3-abe33f584d23&amp;gt; in &amp;lt;module&amp;gt;
----&amp;gt; 1 s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, True)

AttributeError: module 'socket' has no attribute 'SO_REUSEPORT'&lt;/LI-CODE&gt;
&lt;P&gt;I am installing through Anaconda on Ubuntu 20.04.&lt;/P&gt;
&lt;P&gt;If I create a conda virtual environment without INTEL using the same python version 3.7.7, I have the same issue so perhaps it's a problem with the base Anaconda Python version?&lt;/P&gt;
&lt;P&gt;I do not have this issue with the current Anaconda Python 3.8.5 (non-Intel obviously).&lt;/P&gt;
&lt;P&gt;Also, if I pull a docker image for Python 3.7.8 (non-Intel) I don't have this problem.&lt;/P&gt;
&lt;P&gt;(I can't find an Anaconda Python 3.7.8, nor a docker Python 3.7.7, so I can't isolate the problem to Anaconda or the 3.7.7.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming this is not fixable in the current Intel Python release, is Intel planning to switch to Python 3.8 for the next release?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2020 17:40:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1198400#M1503</guid>
      <dc:creator>jerry7</dc:creator>
      <dc:date>2020-08-07T17:40:23Z</dc:date>
    </item>
    <item>
      <title>Re:AttributeError: module 'socket' has no attribut...</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1198967#M1504</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting in Intel Forum.&lt;/P&gt;&lt;P&gt;We could reproduce your issue in python 3.7.7.We will inform this to the concerned team. However we observed that the issue is not present in the older version python 3.6.3. As a workaround, you can use the older version. We are forwarding this query to the concerned team so that they will help you with the future release plan.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raeesa&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Aug 2020 09:33:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1198967#M1504</guid>
      <dc:creator>RaeesaM_Intel</dc:creator>
      <dc:date>2020-08-10T09:33:17Z</dc:date>
    </item>
    <item>
      <title>Re:AttributeError: module 'socket' has no attribut...</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1256505#M1635</link>
      <description>&lt;P&gt;The issue is still there on 3.7.9 release, and we feedbacked the issue back to engineer team.&lt;/P&gt;&lt;P&gt;In the meantime, Does SO_REUSEADDR work for you?&lt;/P&gt;&lt;P&gt;SO_REUSEADDR is functional on current 3.7.9 release.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Feb 2021 19:16:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1256505#M1635</guid>
      <dc:creator>Louie_T_Intel</dc:creator>
      <dc:date>2021-02-16T19:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re:AttributeError: module 'socket' has no attribut...</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1256539#M1636</link>
      <description>&lt;P&gt;Hi Louie,&lt;/P&gt;
&lt;P&gt;Thanks for continuing to track this issue.&lt;/P&gt;
&lt;P&gt;SO_REUSEADDR does work for me in some scenarios, but the as a solution it isn't great and &lt;A href="https://stackoverflow.com/questions/14388706/how-do-so-reuseaddr-and-so-reuseport-differ?rq=1" target="_self"&gt;isn't quite the same&lt;/A&gt;. Although my example was a simple socket.socket() example, I'm mostly losing asyncio, and if you look at:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.create_datagram_endpoint" target="_blank" rel="noopener"&gt;asyncio.loop.create_datagram_endpoint&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you'll see that SO_REUSEADDR is recommended against due to security concerns and is explicitly blocked in 3.8.1 for that reason. They say you should only use SO_REUSEPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did find a hack workaround:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import socket
if not hasattr(socket, 'SO_REUSEPORT'):
    socket.SO_REUSEPORT = 15&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In all the systems I use, SO_REUSEPORT is 15, so this works for me, but it's really not good to do something like this so&lt;EM&gt;&lt;STRONG&gt; I'm very thankful you are still tracking this issue.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As best I can tell this is compile-time issue for Python where it gets the value from the Linux socket C library, so the Intel Engineering Team must be compiling the Python in some way that doesn't get this from the underlying Linux socket interface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please keep me updated as new releases become available.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 20:36:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1256539#M1636</guid>
      <dc:creator>jerry7</dc:creator>
      <dc:date>2021-02-16T20:36:17Z</dc:date>
    </item>
    <item>
      <title>Re:AttributeError: module 'socket' has no attribut...</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1257361#M1640</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;It indeed a compile time issue, and our engineer team is aware of this problem.&lt;/P&gt;&lt;P&gt;They are looking into supporting this in the future and will announce the fix in our webpage or release notes.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Feb 2021 23:01:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/AttributeError-module-socket-has-no-attribute-SO-REUSEPORT/m-p/1257361#M1640</guid>
      <dc:creator>Louie_T_Intel</dc:creator>
      <dc:date>2021-02-18T23:01:16Z</dc:date>
    </item>
  </channel>
</rss>

