alichtman/stronghold

Stronghold using system version of python instead of brew version.

IAmNatch opened this issue · 6 comments

Using terminal and typing "python -V" shows 3.6.5. As well, it's been set in pyenv.

When running stronghold, after setting first security setting, "firewall", the app crashes, siting it's using python 2.7. I've tried sy-linking python 3 to python, using pyenv to set 3.6.5 as default.

Error below:
Traceback (most recent call last):
File "/usr/local/bin/stronghold", line 11, in
sys.exit(cli())
File "/Library/Python/2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/Library/Python/2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Python/2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Python/2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Python/2.7/site-packages/stronghold.py", line 374, in cli
firewall_config()
File "/Library/Python/2.7/site-packages/stronghold.py", line 108, in firewall_config
if sp.run("sudo -E -v", shell=True, stdout=sp.PIPE).returncode != 0:
AttributeError: 'module' object has no attribute 'run'

I see that his was resolved in version 1.5. Weirdly, pip said that I did in fact have 1.5, but stronghold -info said I had 1.3. I resolved this by uninstalling stronghold with pip, and reinstalling it using pip and the release binaries.

This may point to an issue with the current pip release.

Thanks for this great config software!

@IAmNatch Just to clarify, you were not able to install stronghold using the current pip version (1.5)?

Yep, that makes sense.

I introduced some "breaking" changes in 1.4 and 1.5, namely stopping execution of the app if Python 3.x.x wasn't used. I say "breaking" because this isn't Python2 compatible, but with the old setup.py file, pip would allow you to run it with Python2 (and then error fatally soon after.)

I went back and forth about making a major version increment, and decided against it in the end.

Going to close this issue, and mark it as resolved.

$ brew install python3
$ brew postinstall python3
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo python3 get-pip.py
$ pip3 install stronghold
$ stronghold

I had the same issue:

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

Step by steps

Followed https://sourabhbajaj.com/mac-setup/Python/ to set up my mac (and Python).

Then I did,

pip uninstall stronghold
brew install python3
brew postinstall python3
pip3 install stronghold
stronghold

All good!