eth-utils
eth-utils copied to clipboard
Ubuntu-16.04 cannot run populus and error message is "ImportError: cannot import name 'force_text'"
- Version: 2.2.0
- Python: 3.5.2
- OS: linux
- eth_utils: 1.0.1
Problem Description
-
Use pip install populus
pip install populus -
Type this command
populus compile
- Show error message
Traceback (most recent call last):
File "/home/manager/Github_Project/ICO_contracts/venv_3/bin/populus", line 7, in <module>
from populus.cli import main
File "/home/manager/Github_Project/ICO_contracts/venv_3/lib/python3.5/site-packages/populus/__init__.py", line 24, in <module>
from .project import Project # NOQA
File "/home/manager/Github_Project/ICO_contracts/venv_3/lib/python3.5/site-packages/populus/project.py", line 10, in <module>
from populus.config.defaults import (
File "/home/manager/Github_Project/ICO_contracts/venv_3/lib/python3.5/site-packages/populus/config/__init__.py", line 1, in <module>
from .base import ( # noqa: F401
File "/home/manager/Github_Project/ICO_contracts/venv_3/lib/python3.5/site-packages/populus/config/base.py", line 12, in <module>
from populus.utils.mappings import (
File "/home/manager/Github_Project/ICO_contracts/venv_3/lib/python3.5/site-packages/populus/utils/mappings.py", line 8, in <module>
from eth_utils import (
ImportError: cannot import name 'force_text'
How can it be fixed?
Probably the new version of eth-utils has no function named 'force_text' and populus uses it.
Need a method that can compile populus from source code
Try pip install --upgrade web3
Ran into the same issue, @santai87's answer worked as a quick "fix".
This issue is still thorny, and unfortunately in some situations pip install -U web3 won't do.
https://github.com/ethereum/eth-keys/issues/39
Closing this inactive thread, please open a new issue if you experience any further problems.