ImportError: cannot import name 'RAND_egd'

shaunak.bangale at shaunak.bangale at
Wed Feb 10 04:32:42 EST 2016

On Tuesday, February 9, 2016 at 1:33:23 PM UTC-7, Ian wrote:
> On Tue, Feb 9, 2016 at 7:55 AM,  <shaunak.bangale at> 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.

Hi Ian,
Thanks for your reply.
I wasn't trying to import it from _ssl. That was part of the error. My code did not have RAND_egd. I think it was just about ssl package being missing. After installing analcondra distribution, it stopped throwing this particular error at least.

More information about the Python-list mailing list