New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populus Compile Error : "Force_Text" #450

Closed
blackmoneycoin opened this Issue Mar 6, 2018 · 21 comments

Comments

Projects
None yet
@blackmoneycoin

blackmoneycoin commented Mar 6, 2018

  • Populus Version: 2.2.0
  • OS: osx

I am trying to compile contracts with populus and I am getting a "Force_Text" error from eth_utils:

populus comple

Eddies-MBP:Coin edthomas$ populus compile
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/populus", line 11, in
load_entry_point('populus==2.2.0', 'console_scripts', 'populus')()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/init.py", line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/init.py", line 2755, in load_entry_point
return ep.load()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/init.py", line 2408, in load
return self.resolve()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/init.py", line 2414, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/populus/init.py", line 24, in
from .project import Project # NOQA
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/populus/project.py", line 10, in
from populus.config.defaults import (
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/populus/config/init.py", line 1, in
from .base import ( # noqa: F401
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/populus/config/base.py", line 12, in
from populus.utils.mappings import (
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/populus/utils/mappings.py", line 8, in
from eth_utils import (
ImportError: cannot import name 'force_text'

I have installed several times with no effect...

Helpppp..... Thanks in advanced

http://www.photoandtraveling.com/wp-content/uploads/2013/02/Top-of-the-Monkey-hill.jpg

@ndj888

This comment has been minimized.

ndj888 commented Mar 6, 2018

me too

@blackmoneycoin

This comment has been minimized.

blackmoneycoin commented Mar 7, 2018

So does this software work or nah!? I have wasted 2 days trying to get TokenMarketNet to work. I think I am going back to truffle... i have no more time to waste...

@ndj888

This comment has been minimized.

ndj888 commented Mar 7, 2018

@blackmoneycoin I think the software is Invalid. Becuse i try use Osx system or ubentu system ,same problem.

docker ubentu system

PS E:\docker\poplus> docker run -it my/populus /bin/bash
Traceback (most recent call last):
File "/usr/local/bin/populus", line 7, in
from populus.cli import main
File "/usr/local/lib/python3.5/dist-packages/populus/init.py", line 24, in
from .project import Project # NOQA
File "/usr/local/lib/python3.5/dist-packages/populus/project.py", line 10, in
from populus.config.defaults import (
File "/usr/local/lib/python3.5/dist-packages/populus/config/init.py", line 1, in
from .base import ( # noqa: F401
File "/usr/local/lib/python3.5/dist-packages/populus/config/base.py", line 12, in
from populus.utils.mappings import (
File "/usr/local/lib/python3.5/dist-packages/populus/utils/mappings.py", line 8, in
from eth_utils import (
ImportError: cannot import name 'force_text'
PS E:\docker\poplus> docker run -it my/populus
Traceback (most recent call last):
File "/usr/local/bin/populus", line 7, in
from populus.cli import main
File "/usr/local/lib/python3.5/dist-packages/populus/init.py", line 24, in
from .project import Project # NOQA
File "/usr/local/lib/python3.5/dist-packages/populus/project.py", line 10, in
from populus.config.defaults import (
File "/usr/local/lib/python3.5/dist-packages/populus/config/init.py", line 1, in
from .base import ( # noqa: F401
File "/usr/local/lib/python3.5/dist-packages/populus/config/base.py", line 12, in
from populus.utils.mappings import (
File "/usr/local/lib/python3.5/dist-packages/populus/utils/mappings.py", line 8, in
from eth_utils import (
ImportError: cannot import name 'force_text'

@angelano

This comment has been minimized.

angelano commented Mar 7, 2018

The current master doesn't work right now because it uses a deprecated function of eth_utils. See #447 and ethereum/eth-utils#58. If you install previous version of eth_utils, populus will work fine. I think this is a reasonable work around before the issue is fixed.

@santai87

This comment has been minimized.

santai87 commented Mar 7, 2018

Try this command:

pip install --upgrade web3

This command will downgrade eth-utils from 1.0.1 to 0.8.1

Then populus will work fine.

@tuxxy

This comment has been minimized.

tuxxy commented Apr 2, 2018

Any update on this? This is really annoying.

@pipermerriam

This comment has been minimized.

Member

pipermerriam commented Apr 2, 2018

For now, you'll need to try what @santai87 proposed. Populus is currenly without a maintainer, but that should change in the coming few months.

@aleczadikian

This comment has been minimized.

aleczadikian commented Apr 6, 2018

@santai87 's fix isn't working for me in Python 3. I ran pip3 install --upgrade populus and pip3 install --upgrade web3==0.1.8 (tried a few other versions too) and get a similar error when I try to run populus:

Traceback (most recent call last):
  File "/usr/local/bin/populus", line 7, in <module>
    from populus.cli import main
  File "/usr/local/lib/python3.4/dist-packages/populus/__init__.py", line 24, in <module>
    from .project import Project  # NOQA
  File "/usr/local/lib/python3.4/dist-packages/populus/project.py", line 14, in <module>
    from populus.compilation import (
  File "/usr/local/lib/python3.4/dist-packages/populus/compilation/__init__.py", line 7, in <module>
    from populus.utils.compile import (
  File "/usr/local/lib/python3.4/dist-packages/populus/utils/compile.py", line 31, in <module>
    from .contracts import (
  File "/usr/local/lib/python3.4/dist-packages/populus/utils/contracts.py", line 12, in <module>
    from .string import (
  File "/usr/local/lib/python3.4/dist-packages/populus/utils/string.py", line 3, in <module>
    from eth_utils import (
ImportError: cannot import name 'force_bytes'
@volconst

This comment has been minimized.

volconst commented Apr 8, 2018

This worked for me:
pip install eth-utils==0.8.1 web3==3.16.5

@mikeshultz

This comment has been minimized.

mikeshultz commented Apr 21, 2018

Tried to clean up the dependency issues a little bit but wasn't able to find a set of releases that all worked together. With some of the newest it seems there's some dependencies that all seem to have issues with pypanadoc in their pypi releases, and until new releases come out, you'll probably have to do the same as me and install these github:

EDIT: Scratch that. It still just wind up with the original error in this issue.

@nsavageJVM

This comment has been minimized.

nsavageJVM commented May 15, 2018

@mikeshultz
fresh install ubuntu 16 then
sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev automake pkg-config libtool libgmp-dev autoconf dh-autoreconf
sudo apt install python3-pip
sudo pip3 install --upgrade setuptools
sudo pip3 install --upgrade ez_setup
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
sudo apt-get install ethereum
sudo -H pip3 install populus
then @volconst update
pip3 install eth-utils==0.8.1 web3==3.16.5
then see issue for project.json "Tests not running without project.json "
now populus init default tests pass
update
my best install works on ubuntu 18 python 3.6, I needed ubuntu package libsecp256k1-dev and ommit
@volconst update, populus installs and default test pass

@stfairy

This comment has been minimized.

stfairy commented Jun 15, 2018

With pip3 install eth-utils==0.8.1 web3==3.16.5 I couldn't run py.test tests/. Had to run pip3 install eth-utils==0.7.4

@asofyan

This comment has been minimized.

asofyan commented Aug 8, 2018

Tried this:
pip install eth-utils==0.8.1 web3==3.16.5

populus init is working, but on py.test, it failed again..

pluggy.manager.PluginValidationError: Plugin 'ethereum' could not be loaded: (eth-utils 0.8.1 (/Users/me/web/python/.eth/lib/python3.6/site-packages), Requirement.parse('eth-utils==0.7.*'), {'eth-abi'})!

Is there any development on this?

@voith

This comment has been minimized.

Collaborator

voith commented Aug 8, 2018

This will be fixed in #474

@asofyan

This comment has been minimized.

asofyan commented Aug 8, 2018

Thanks @voith, do you have any merged version of #474 ? I need to get it working now.. Thanks..

@voith

This comment has been minimized.

Collaborator

voith commented Aug 8, 2018

I don't. The thing is populus has not been maintained for a long time. Wait for a week or two and all the related fixes should get into master.

@voith

This comment has been minimized.

Collaborator

voith commented Aug 8, 2018

@asofyan you could probably install from my fork. I have added several fixes to this branch which are combinations of severals PR's that I've opened.
try this:

pip install -e git+https://github.com/voith/populus.git@new-populus-ico#egg=populus

However, make sure that you have removed other dependencies like eth-utils, web3 from your requiremenets.txt or setup.py. Also, try to use solidity 0.4.24 if you decide to use my branch.

@asofyan

This comment has been minimized.

asofyan commented Aug 8, 2018

Thanks @voith, will try to use your fork until this merged into master. Appreciated.

@voith

This comment has been minimized.

Collaborator

voith commented Aug 9, 2018

@asofyan Note. Try to copy project.json from here. I've changed the version to 9 and some keys have been removed. If you don't copy project.json from there then you might get some nasty errors.
There's a populus channel on gitter. Feel free to ask me questions there.

@voith

This comment has been minimized.

Collaborator

voith commented Sep 3, 2018

This issue was fixed in #474. Please trying installing populus from master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment