ImportError: cannot import name 'RAND_egd'

Ian Kelly ian.g.kelly at gmail.com
Tue Feb 9 15:32:22 EST 2016


On Tue, Feb 9, 2016 at 7:55 AM,  <shaunak.bangale at gmail.com> wrote:
> Hi,
>
> I am trying to run a 60 lines Python code which is running on a mac machine but on windows machine, I am getting this error when I run on it on shell(open file and run module). I have Python 3.5 installed.
>
>    from _ssl import RAND_status, RAND_egd, RAND_add
> ImportError: cannot import name 'RAND_egd'

Why are you importing these directly from the "_ssl" C module and not
from the "ssl" wrapper module? Anything that starts with an _ should
be considered a private implementation detail and shouldn't be relied
upon.

> Form forums, I found that it is a common error but could not find a good solution that will work for me.
>
> One of the ways was to create scripts folder and putting easy_install.exe and then running easy_install pip but that gave me sytnax error.
>
> Please advise. Thanks in advance.

The ssl module in the standard library has this:

try:
    from _ssl import RAND_egd
except ImportError:
    # LibreSSL does not provide RAND_egd
    pass

So it looks like you cannot depend on ssl.RAND_egd to be present.



More information about the Python-list mailing list