eth-utils icon indicating copy to clipboard operation
eth-utils copied to clipboard

Ubuntu-16.04 cannot run populus and error message is "ImportError: cannot import name 'force_text'"

Open santai87 opened this issue 7 years ago • 3 comments

  • Version: 2.2.0
  • Python: 3.5.2
  • OS: linux
  • eth_utils: 1.0.1

Problem Description

  1. Use pip install populus pip install populus

  2. Type this command

populus compile

  1. 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

santai87 avatar Mar 07 '18 11:03 santai87

Try pip install --upgrade web3

santai87 avatar Mar 07 '18 13:03 santai87

Ran into the same issue, @santai87's answer worked as a quick "fix".

Netherdrake avatar Mar 14 '18 13:03 Netherdrake

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

Netherdrake avatar Mar 19 '18 20:03 Netherdrake

Closing this inactive thread, please open a new issue if you experience any further problems.

reedsa avatar Sep 29 '23 19:09 reedsa