Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #102727 > unrolled thread

ImportError: cannot import name 'RAND_egd'

Started byshaunak.bangale@gmail.com
First post2016-02-09 06:55 -0800
Last post2016-02-10 01:32 -0800
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  ImportError: cannot import name 'RAND_egd' shaunak.bangale@gmail.com - 2016-02-09 06:55 -0800
    Re: ImportError: cannot import name 'RAND_egd' Ian Kelly <ian.g.kelly@gmail.com> - 2016-02-09 13:32 -0700
      Re: ImportError: cannot import name 'RAND_egd' shaunak.bangale@gmail.com - 2016-02-10 01:32 -0800

#102727 — ImportError: cannot import name 'RAND_egd'

Fromshaunak.bangale@gmail.com
Date2016-02-09 06:55 -0800
SubjectImportError: cannot import name 'RAND_egd'
Message-ID<4c113094-db27-4b60-9140-eded08939ab0@googlegroups.com>
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'

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.

Regards
Shaunak

[toc] | [next] | [standalone]


#102733

FromIan Kelly <ian.g.kelly@gmail.com>
Date2016-02-09 13:32 -0700
Message-ID<mailman.0.1455049984.7749.python-list@python.org>
In reply to#102727
On Tue, Feb 9, 2016 at 7:55 AM,  <shaunak.bangale@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.

[toc] | [prev] | [next] | [standalone]


#102758

Fromshaunak.bangale@gmail.com
Date2016-02-10 01:32 -0800
Message-ID<76905ae4-626d-4f36-9575-474ae54a21a9@googlegroups.com>
In reply to#102733
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@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.

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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web