[pycrypto] ImportError: cannot import name _counter

Parthy Chandrasekaran partheinstein at gmail.com
Thu Apr 5 14:47:37 EDT 2012


Hi,

I need to install pycryto module to use another module (paramiko).
I've installed pycrypto 2.5 for Python 2.7 on Windows XP as follows:

C:\Tools\python\pycrypto-2.5.tar\dist\pycrypto-2.5\pycrypto-2.5>python
setup.py install --install-platbase win32
running install
running build
running build_py
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

running install_lib
copying build\lib.win32-2.7\Crypto\Cipher\AES.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Cipher
copying build\lib.win32-2.7\Crypto\Cipher\ARC2.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Cipher
copying build\lib.win32-2.7\Crypto\Cipher\ARC4.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Cipher
copying build\lib.win32-2.7\Crypto\Cipher\Blowfish.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Cipher
copying build\lib.win32-2.7\Crypto\Cipher\CAST.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Cipher
copying build\lib.win32-2.7\Crypto\Cipher\DES.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Cipher
copying build\lib.win32-2.7\Crypto\Cipher\DES3.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Cipher
copying build\lib.win32-2.7\Crypto\Cipher\XOR.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Cipher
copying build\lib.win32-2.7\Crypto\Hash\_MD2.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Hash
copying build\lib.win32-2.7\Crypto\Hash\_MD4.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Hash
copying build\lib.win32-2.7\Crypto\Hash\_RIPEMD160.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Hash
copying build\lib.win32-2.7\Crypto\Hash\_SHA224.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Hash
copying build\lib.win32-2.7\Crypto\Hash\_SHA256.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Hash
copying build\lib.win32-2.7\Crypto\Hash\_SHA384.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Hash
copying build\lib.win32-2.7\Crypto\Hash\_SHA512.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Hash
copying build\lib.win32-2.7\Crypto\Random\OSRNG\winrandom.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Random\OSRNG
copying build\lib.win32-2.7\Crypto\Util\strxor.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Util
copying build\lib.win32-2.7\Crypto\Util\_counter.pyd ->
C:\Tools\python\Python27\Lib\site-packages\Crypto\Util
running install_egg_info
Removing C:\Tools\python\Python27\Lib\site-packages\pycrypto-2.5-py2.7.egg-info
Writing C:\Tools\python\Python27\Lib\site-packages\pycrypto-2.5-py2.7.egg-info

When I run the self-test for counter, I get an ImportError for _counter:

C:\Tools\python\pycrypto-2.5.tar\dist\pycrypto-2.5\pycrypto-2.5\lib\Crypto\SelfTest\Util>python
test_Counter.py

  File "test_Counter.py", line 39, in setUp
    from Crypto.Util import Counter
  File "C:\Tools\python\Python27\lib\Crypto\Util\Counter.py", line30,
in <module>
    from Crypto.Util import _counter
ImportError: cannot import name _counter

Any ideas on how I can resolve this import error?

thanks
partheinstein


More information about the pycrypto mailing list