BlockCatIO / solidity-flattener

A python utility to flatten Solidity code with imports into a single file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'module' object has no attribute 'run'

parth5049 opened this issue · comments

Hello Guys,

I am facing following error while trying to flatten this target file. Please help me.

$ solidity_flattener contracts/MyDummyCoin.sol Traceback (most recent call last): File "/home/ztlab07/.local/bin/solidity_flattener", line 4, in <module> flattener.core.main() File "/home/ztlab07/.local/lib/python2.7/site-packages/flattener/core.py", line 96, in main solc_proc = subprocess.run(solc_args, stdout=subprocess.PIPE, universal_newlines=True) AttributeError: 'module' object has no attribute 'run'

commented

Sorry! This is a 2.7 issue I thought I'd addressed. I'll look into it ASAP. Thank you for the report!

The problem is in the documentation. You should use
pip3 install solidity-flattener

commented

Correct, @izetex. My intention was to make the flattener Python2 compatible as well, so I'll leave this open as I address the backwards compatibility.

Is this still an issue?

pip --version

pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

but still getting:

AttributeError: 'module' object has no attribute 'run'

Is this still an issue?

pip --version

pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

but still getting:

AttributeError: 'module' object has no attribute 'run'

Nevermind. Re-running the install using pip3 seemed to resolve the issue:

pip3 install solidity-flattener

Thanks, @Stickerpants I made it work with Pip3. Please feel free to close the issue when you are good.

commented

Sounds good. Thank you @parth5049 !

@Stickerpants I don't understand. Why is working on pip3 considered a fix for a Python 2 issue? Sadly which python for Debian 10 is still Python 2. And lol, this issue is the number 2 Google result for the error message. See a fix here: https://github.com/poikilos/linux-preinstall/blob/master/utilities/install_any.py (I re-posted it here: https://stackoverflow.com/a/66464733/4541104).