BlockCatIO / solidity-flattener

A python utility to flatten Solidity code with imports into a single file.
MIT License
267 stars 98 forks source link

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

Closed parth5049 closed 4 years ago

parth5049 commented 6 years ago

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'

Stickerpants commented 6 years ago

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

izetex commented 6 years ago

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

Stickerpants commented 6 years ago

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.

haydenyoung commented 5 years ago

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'

haydenyoung commented 5 years ago

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

parth5049 commented 4 years ago

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

Stickerpants commented 4 years ago

Sounds good. Thank you @parth5049 !

Poikilos commented 3 years ago

@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).