Web3.py: ImportError: cannot import name 'scrypt'

Created on 7 Apr 2018  路  3Comments  路  Source: ethereum/web3.py

  • Version: 4.0.0
  • Python: 3.6.5 (Anaconda Full Distribution)
  • OS: linux
~ % ipython
Python 3.6.5 |Anaconda custom (64-bit)| (default, Mar 29 2018, 18:21:58) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.3.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import web3
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-818c60069f6c> in <module>()
----> 1 import web3

~/anaconda3/lib/python3.6/site-packages/web3/__init__.py in <module>()
      5     raise EnvironmentError("Python 3.5 or above is required")
      6 
----> 7 from eth_account import Account  # noqa: E402
      8 from web3.main import Web3  # noqa: E402
      9 from web3.providers.rpc import (  # noqa: E402

~/anaconda3/lib/python3.6/site-packages/eth_account/__init__.py in <module>()
----> 1 from eth_account.account import Account  # noqa: F401

~/anaconda3/lib/python3.6/site-packages/eth_account/account.py in <module>()
      5 import os
      6 
----> 7 from eth_keyfile import (
      8     create_keyfile_json,
      9     decode_keyfile_json,

~/anaconda3/lib/python3.6/site-packages/eth_keyfile/__init__.py in <module>()
      5 import sys
      6 
----> 7 from eth_keyfile.keyfile import (  # noqa: F401
      8     load_keyfile,
      9     create_keyfile_json,

~/anaconda3/lib/python3.6/site-packages/eth_keyfile/keyfile.py in <module>()
      5 from Crypto import Random
      6 from Crypto.Cipher import AES
----> 7 from Crypto.Protocol.KDF import scrypt
      8 from Crypto.Util import Counter
      9 

ImportError: cannot import name 'scrypt'

In [2]:                                                                                                         
Do you really want to exit ([y]/n)? y
~ % ls /home/user/anaconda3/lib/python3.6/site-packages/ | grep eth
eth_abi
eth_abi-1.0.0.dist-info
eth_account
eth_account-0.2.0a0.dist-info
eth_hash
eth_hash-0.1.2.dist-info
eth_keyfile
eth_keyfile-0.5.1.dist-info
eth_keys
eth_keys-0.2.0b3.dist-info
eth_rlp
eth_rlp-0.1.0.dist-info
eth_utils
eth_utils-1.0.2.dist-info

Most helpful comment

Fix:

pip uninstall pycrypto
pip uninstall pycryptodome
pip install pycryptodome

All 3 comments

Fix:

pip uninstall pycrypto
pip uninstall pycryptodome
pip install pycryptodome

Same issue, comment below dows not help @Netherdrake

Thanks!

@BeOleg what version of web3 are you using? And did you try to install in a fresh environment already?

Was this page helpful?
0 / 5 - 0 ratings