question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No module named 'rlp.codec'

See original GitHub issue
  • py-evm Version: xxx
  • trinity Version:eth-0.2.0a31
  • OS: osx
  • Python Version (python --version): Python 3.6.4 :: Anaconda, Inc.
  • Environment (output of pip freeze):

alabaster==0.7.11 apipkg==1.5 appnope==0.1.0 argh==0.26.2 asn1crypto==0.24.0 async-lru==0.1.0 asyncio-cancel-token==0.1.0a2 atomicwrites==1.2.1 attrdict==2.0.0 attrs==18.1.0 Babel==2.6.0 backcall==0.1.0 bloom-filter==1.3 bumpversion==0.5.3 cachetools==2.1.0 certifi==2018.8.24 cffi==1.11.5 chardet==3.0.4 coincurve==8.0.2 colorama==0.3.9 coverage==4.5.1 cryptography==2.3.1 cytoolz==0.9.0.1 decorator==4.3.0 docopt==0.6.2 docutils==0.14 eth-abi==1.2.0 eth-account==0.2.3 eth-bloom==1.0.0 eth-hash==0.1.4 eth-keyfile==0.5.1 eth-keys==0.2.0b3 eth-rlp==0.1.2 eth-typing==1.3.0 eth-utils==1.2.1 execnet==1.5.0 flake8==3.5.0 hexbytes==0.1.0 hypothesis==3.69.5 idna==2.7 imagesize==1.0.0 ipython==6.5.0 ipython-genutils==0.2.0 jedi==0.12.1 Jinja2==2.10 lahja==0.6.1 lru-dict==1.1.6 lxml==4.2.4 MarkupSafe==1.0 mccabe==0.6.1 more-itertools==4.3.0 mypy==0.620 netdisco==2.0.0 netifaces==0.10.7 packaging==17.1 parsimonious==0.8.0 parso==0.3.1 pathtools==0.1.2 pexpect==4.6.0 pickleshare==0.7.4 pkginfo==1.4.2 pluggy==0.7.1 plyvel==1.0.5 prompt-toolkit==1.0.15 ptyprocess==0.6.0 py==1.6.0 py-ecc==1.4.3 -e git+git@github.com:ethereum/py-evm.git@632bf8a710d8bfc2f20e7d25f9976f9bcd25ff51#egg=py_evm pycodestyle==2.3.1 pycparser==2.18 pycryptodome==3.6.6 pyethash==0.1.27 pyflakes==1.6.0 Pygments==2.2.0 pyparsing==2.2.0 pysha3==1.0.2 pytest==3.6.4 pytest-asyncio==0.9.0 pytest-asyncio-network-simulator==0.1.0a2 pytest-cov==2.5.1 pytest-watch==4.2.0 pytest-xdist==1.18.1 python-dateutil==2.7.3 pytz==2018.5 PyYAML==3.13 requests==2.19.1 requests-toolbelt==0.8.0 rlp==1.0.2 simplegeneric==0.8.1 six==1.11.0 snowballstemmer==1.2.1 Sphinx==1.7.8 sphinx-rtd-theme==0.4.1 sphinxcontrib-asyncio==0.2.0 sphinxcontrib-websupport==1.1.0 toolz==0.9.0 tox==2.7.0 tqdm==4.25.0 traitlets==4.3.2 trie==1.3.8 twine==1.11.0 typed-ast==1.1.0 uPnPClient==0.0.8 urllib3==1.23 virtualenv==16.0.0 watchdog==0.9.0 wcwidth==0.1.7 web3==4.4.1 websockets==5.0.1 zeroconf==0.20.0

What is wrong?

i want to read and run the trinity code, but the always show error

No module named 'rlp.codec'

There is a rlp folder under the trinity directory how import rlp from site-packages not the rlp folder?

image

(py-evm-VXvi0lYJ) ➜  py-evm git:(master) ✗ python trinity/main.py      
Traceback (most recent call last):
  File "trinity/main.py", line 18, in <module>
    from eth.chains.mainnet import (
  File "/Users/gaojin/Documents/GitHub/py-evm/eth/__init__.py", line 14, in <module>
    from eth.chains import (  # noqa: F401
  File "/Users/gaojin/Documents/GitHub/py-evm/eth/chains/__init__.py", line 1, in <module>
    from .base import (  # noqa: F401
  File "/Users/gaojin/Documents/GitHub/py-evm/eth/chains/base.py", line 46, in <module>
    from eth.db.chain import (
  File "/Users/gaojin/Documents/GitHub/py-evm/eth/db/chain.py", line 18, in <module>
    from trie import (
  File "/Users/gaojin/.local/share/virtualenvs/py-evm-VXvi0lYJ/lib/python3.6/site-packages/trie/__init__.py", line 7, in <module>
    from .hexary import (  # noqa: F401
  File "/Users/gaojin/.local/share/virtualenvs/py-evm-VXvi0lYJ/lib/python3.6/site-packages/trie/hexary.py", line 5, in <module>
    from rlp.codec import encode_raw
ModuleNotFoundError: No module named 'rlp.codec'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
jin10086commented, Sep 18, 2018

Thank you very much, this is very helpful to me.

0reactions
cburgdorfcommented, Sep 18, 2018

Ah, understood! No, running python trinity/main.py doesn’t work for me either. I’m also running into:

$ python trinity/main.py 
Traceback (most recent call last):
  File "trinity/main.py", line 17, in <module>
    from eth.chains.mainnet import (
  File "/home/cburgdorf/Documents/hacking/ef/py-evm/eth/__init__.py", line 14, in <module>
    from eth.chains import (  # noqa: F401
  File "/home/cburgdorf/Documents/hacking/ef/py-evm/eth/chains/__init__.py", line 1, in <module>
    from .base import (  # noqa: F401
  File "/home/cburgdorf/Documents/hacking/ef/py-evm/eth/chains/base.py", line 46, in <module>
    from eth.db.chain import (
  File "/home/cburgdorf/Documents/hacking/ef/py-evm/eth/db/chain.py", line 18, in <module>
    from trie import (
  File "/home/cburgdorf/Documents/hacking/ef/py-evm/venv3/lib/python3.6/site-packages/trie/__init__.py", line 7, in <module>
    from .hexary import (  # noqa: F401
  File "/home/cburgdorf/Documents/hacking/ef/py-evm/venv3/lib/python3.6/site-packages/trie/hexary.py", line 5, in <module>
    from rlp.codec import encode_raw
ModuleNotFoundError: No module named 'rlp.codec'

Btw, notice that this kind of launch would also need this to be added:

if __name__ == "__main__":
    main()

However, I don’t know where this error comes from and I know that this kind of launch used to work a couple of months back. However, if you really want to start trinity using python <something> instead of just launching it through the trinity command, you can do so by running python -m trinity.main which will give you a bunch of warnings but beside that will launch trinity just fine.

$ python -m trinity.main
/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'trinity.main' found in sys.modules after import of package 'trinity', but prior to execution of 'trinity.main'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
    INFO  09-18 11:30:08        main  
      ______     _       _ __       
     /_  __/____(_)___  (_) /___  __
      / / / ___/ / __ \/ / __/ / / /
     / / / /  / / / / / / /_/ /_/ / 
    /_/ /_/  /_/_/ /_/_/\__/\__, /  
                           /____/   
    INFO  09-18 11:30:08        main  Trinity/eth-0.2.0a32/linux/cpython3.6.5
    INFO  09-18 11:30:08        main  Trinity DEBUG log file is created at /home/cburgdorf/.local/share/trinity/mainnet/logs/trinity.log
    INFO  09-18 11:30:08        main  Started DB server process (pid=9435)
/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'trinity.main' found in sys.modules after import of package 'trinity', but prior to execution of 'trinity.main'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
    INFO  09-18 11:30:08        main  Started networking process (pid=9439)
    INFO  09-18 11:30:08  plugin_manager  Plugin started: JSON-RPC Server
/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'trinity.main' found in sys.modules after import of package 'trinity', but prior to execution of 'trinity.main'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'trinity.main' found in sys.modules after import of package 'trinity', but prior to execution of 'trinity.main'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
    INFO  09-18 11:30:09      plugin  JSON-RPC Server started
    INFO  09-18 11:30:09         ipc  IPC started at: /home/cburgdorf/.local/share/trinity/mainnet/jsonrpc.ipc
    INFO  09-18 11:30:09      server  Running server...
    INFO  09-18 11:30:09         nat  Setting up NAT portmap...
/usr/lib/python3.6/runpy.py:125: RuntimeWarning: 'trinity.main' found in sys.modules after import of package 'trinity', but prior to execution of 'trinity.main'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))

I’m far from being a Python expert so I can’t explain to you the details of why things are the way they are but I hope this gives you the right pointers to address your problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named 'rlp' - Technical - Blockcerts Forum
I am trying to issue certificate in ethereum ropsten testnet. But I am facing error-. (venv) bash-4.3# pwd /cert-issuer
Read more >
rlp - Go Packages
Package rlp implements the RLP serialization format. The purpose of RLP (Recursive Linear Prefix) is to encode arbitrarily nested arrays of ...
Read more >
pyrlp Documentation - Read the Docs
pyrlp is a package for encoding and decoding data to and from recursive length prefix encoding (RLP). This format.
Read more >
No module named 'codecs' ---Mac - python - Stack Overflow
I can't do any programming without solving it. The following is my error when I type "pip3 install codecs" (or type pip install...
Read more >
Recursive Length Prefix - Web3j
The RLP encoder defined two supported types: ... The RLP module in web3j provides RLP encoding capabilities, with the RlpEncoderTest demonstrating encoding ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found