py-evm icon indicating copy to clipboard operation
py-evm copied to clipboard

Guide on Building an App needs additional requirements

Open montsamu opened this issue 4 years ago • 1 comments

  • py-evm Version: 0.3.0a20
  • OS: ubuntu (on windows linux subsystem)
  • Python Version (python --version): 3.6.9
  • Environment (output of pip freeze):

(venv) samont@l10c367:~$ pip freeze blake2b-py==0.1.3 cached-property==1.5.2 cytoolz==0.11.0 eth-bloom==1.0.3 eth-hash==0.2.0 eth-keys==0.3.3 eth-typing==2.2.2 eth-utils==1.9.5 hexbytes==0.2.1 lru-dict==1.1.6 mypy-extensions==0.4.3 py-ecc==4.1.0 py-evm==0.3.0a20 pyethash==0.1.27 rlp==2.0.1 sortedcontainers==2.3.0 toolz==0.11.1 trie==2.0.0a5 typing-extensions==3.7.4.3

What is wrong?

Using the guide here:

https://py-evm.readthedocs.io/en/latest/guides/building_an_app_that_uses_pyevm.html

When running the app, eventually eth_hash/utils.py fails in choose_available_backend with:

ImportError: None of these hashing backends are installed: ['pycryptodome', 'pysha3']. Install with pip install eth-hash[pycryptodome].

How can it be fixed

Include additional requirement in the 'add the py-evm library as a dependency' section, or include one of the hashing backends in py-evm's own requirements.

Example:

pip install eth-hash[pysha3]

Then running the app/main.py does give the expected result. I am happy to make this (tiny) fix to the guide, however if it is better to include this as a dependency of py-evm itself that would require further discussion of course.

montsamu avatar Jan 08 '21 16:01 montsamu

am happy to make this (tiny) fix to the guide

That would be appreciated

however if it is better to include this as a dependency of py-evm itself that would require further discussion of course.

It is omitted by design so that the user get to choose which kind of hashing backend they want to choose (e.g. a fast native one for production vs a python one for learning purpose)

cburgdorf avatar Jan 11 '21 09:01 cburgdorf