Error 'No module named _sha256' when importing random in python 2.7.1

Wong Wah Meng-R32813 r32813 at freescale.com
Tue Sep 27 12:04:50 CEST 2011


Yes I did. In fact earlier "make test" failed to execute due to _sha256 not found in one of the module testing. 

Earlier I ignored these failures from the build and make test as I thought they are not needed by my application. Now I can't use "random" module in my application. So I need to solve this issue. 

Here is the output of the build. 

Python build finished, but the necessary bits to build these modules were not found:
_bsddb             _curses            _curses_panel   
_sqlite3           _ssl               bsddb185        
bz2                dl                 gdbm            
imageop            linuxaudiodev      ossaudiodev     
readline           spwd               sunaudiodev     
zlib                                                  
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


Failed to build these modules:
_ctypes            termios                            

Regards,
Wah Meng

-----Original Message-----
From: chris at rebertia.com [mailto:chris at rebertia.com] On Behalf Of Chris Rebert
Sent: Tuesday, September 27, 2011 5:52 PM
To: Wong Wah Meng-R32813
Cc: python-list at python.org
Subject: Re: Error 'No module named _sha256' when importing random in python 2.7.1

On Tue, Sep 27, 2011 at 2:28 AM, Wong Wah Meng-R32813
<r32813 at freescale.com> wrote:
> I just built python 2.7.1 on my HP Itanium 64-bit platform, using aCC. I encountered following issue when importing the random module. Does anyone know why am I getting this error? Thanks in advance for your reply.
<snip>
>  File "hashlib.py", line 74, in __get_builtin_constructor
>    import _sha256
> ImportError: No module named _sha256

Did you get a message along the lines of "Python build finished, but
the necessary bits to build these modules were not found:" when you
built Python?

Cheers,
Chris





More information about the Python-list mailing list