pacu icon indicating copy to clipboard operation
pacu copied to clipboard

Install fail on ec2/linux2 using ssm-user

Open ean007 opened this issue 4 years ago • 2 comments

Hi - I get the below error message when running bash install.sh on ec2/linux2. I tried as root. pip3 list shows the correct modules installed. But python3 pacu.py shows an error. see further below. I'll also copy/paste pip3 list.

h-4.2$ bash install.sh
[ + ] Checking Python version . . .
[ $ ] python3 --version
Python 3.7.9
[ + ] Your Python version is compatible with Pacu.
[ + ] Installing Pacu's Python package dependencies . . .
[ $ ] pip3 install -r requirements.txt
_**Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3.7/site-packages/pip/commands/install.py", line 365, in run
    strip_file_prefix=options.strip_file_prefix,
  File "/usr/lib/python3.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/lib/python3.7/site-packages/pip/req/req_install.py", line 854, in install
    strip_file_prefix=strip_file_prefix
  File "/usr/lib/python3.7/site-packages/pip/req/req_install.py", line 1069, in move_wheel_files
    strip_file_prefix=strip_file_prefix,
  File "/usr/lib/python3.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python3.7/site-packages/pip/wheel.py", line 287, in clobber
    ensure_dir(dest)  # common for the 'include' path
  File "/usr/lib/python3.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib64/python3.7/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib64/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.7'**_
Collecting awscli (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/ec/0c/7010907f5ba23096ee9d651831a7fe3a8127f3ac7ff0c5784478ce308eaa/awscli-1.18.163-py2.py3-none-any.whl (3.4MB)
Collecting boto3 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/1c/6f/50be8234f5c2c95a047647bfded004f78bf0de5b46d43fbffef3f7f2e4c6/boto3-1.16.3-py2.py3-none-any.whl (129kB)
Collecting botocore (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/10/4f/0af21f061279d1fa5f6bb0939f1b2499da61947740faa7276e8039b08c56/botocore-1.19.3-py2.py3-none-any.whl (6.7MB)
Collecting s3transfer==0.1.13 (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl
Collecting flake8==3.5.0 (from -r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/b9/dc/14e9d94c770b8c4ef584e906c7583e74864786a58d47de101f2767d50c0b/flake8-3.5.0-py2.py3-none-any.whl
Collecting pytz==2018.5 (from -r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/30/4e/27c34b62430286c6d59177a0842ed90dc789ce5d1ed740887653b898779a/pytz-2018.5-py2.py3-none-any.whl
Collecting requests==2.20.0 (from -r requirements.txt (line 7))
  Using cached https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8/requests-2.20.0-py2.py3-none-any.whl
Collecting urllib3==1.22 (from -r requirements.txt (line 8))
  Using cached https://files.pythonhosted.org/packages/63/cb/6965947c13a94236f6d4b8223e21beb4d576dc72e8130bd7880f600839b8/urllib3-1.22-py2.py3-none-any.whl
Collecting SQLAlchemy==1.3.6 (from -r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/55/98/56b7155bab287cd0c78dee26258835db36e91f2efef41f125ed6f6f1f334/SQLAlchemy-1.3.6.tar.gz
Collecting SQLAlchemy-Utils==0.33.3 (from -r requirements.txt (line 10))
  Using cached https://files.pythonhosted.org/packages/28/17/fedf5a8b2492a7d12986273b7d661419970b1866f3be3f897114aa3c7195/SQLAlchemy-Utils-0.33.3.tar.gz
Collecting PyYAML<5.4,>=3.10; python_version != "3.4" (from awscli->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz
Collecting docutils<0.16,>=0.10 (from awscli->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/22/cd/a6aa959dca619918ccb55023b4cb151949c64d4d5d55b3f4ffd7eee0c6e8/docutils-0.15.2-py3-none-any.whl
Collecting rsa<=4.5.0,>=3.1.2; python_version != "3.4" (from awscli->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/26/f8/8127fdda0294f044121d20aac7785feb810e159098447967a6103dedfb96/rsa-4.5-py2.py3-none-any.whl
Collecting colorama<0.4.4,>=0.2.5; python_version != "3.4" (from awscli->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/c9/dc/45cdef1b4d119eb96316b3117e6d5708a08029992b2fee2c143c7a0a5cc5/colorama-0.4.3-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->-r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/07/cb/5f001272b6faeb23c1c9e0acc04d48eaaf5c862c17709d20e3469c6e0139/jmespath-0.10.0-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting mccabe<0.7.0,>=0.6.0 (from flake8==3.5.0->-r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting pycodestyle<2.4.0,>=2.0.0 (from flake8==3.5.0->-r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/e4/81/78fe51eb4038d1388b7217dd63770b0f428370207125047312886c923b26/pycodestyle-2.3.1-py2.py3-none-any.whl
Collecting pyflakes<1.7.0,>=1.5.0 (from flake8==3.5.0->-r requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/d7/40/733bcc64da3161ae4122c11e88269f276358ca29335468005cb0ee538665/pyflakes-1.6.0-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests==2.20.0->-r requirements.txt (line 7))
  Using cached https://files.pythonhosted.org/packages/5e/c4/6c4fe722df5343c33226f0b4e0bb042e4dc13483228b4718baf286f86d87/certifi-2020.6.20-py2.py3-none-any.whl
Collecting idna<2.8,>=2.5 (from requests==2.20.0->-r requirements.txt (line 7))
  Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests==2.20.0->-r requirements.txt (line 7))
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting six (from SQLAlchemy-Utils==0.33.3->-r requirements.txt (line 10))
  Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting pyasn1>=0.1.3 (from rsa<=4.5.0,>=3.1.2; python_version != "3.4"->awscli->-r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, urllib3, jmespath, botocore, PyYAML, docutils, pyasn1, rsa, s3transfer, colorama, awscli, boto3, mccabe, pycodestyle, pyflakes, flake8, pytz, certifi, idna, chardet, requests, SQLAlchemy, SQLAlchemy-Utils
\033[38;5;202m[ - ] Pip raised an error while installing Pacu's Python package dependencies.
All Python packages used by Pacu should be installed before pacu.py is run.
It may be helpful to try running `pip install -r requirements.txt` directly.
For assistance troubleshooting pip installation problems, please provide the
developers with as much information about this error as possible, including all
text output by install.sh. (exit 2)\033[38;5;00m

sh-4.2$ python3 pacu.py Traceback (most recent call last): File "pacu.py", line 18, in import boto3 File "/usr/local/lib/python3.7/site-packages/boto3/init.py", line 16, in from boto3.session import Session File "/usr/local/lib/python3.7/site-packages/boto3/session.py", line 17, in import botocore.session File "/usr/local/lib/python3.7/site-packages/botocore/session.py", line 30, in import botocore.credentials File "/usr/local/lib/python3.7/site-packages/botocore/credentials.py", line 34, in from botocore.config import Config File "/usr/local/lib/python3.7/site-packages/botocore/config.py", line 16, in from botocore.endpoint import DEFAULT_TIMEOUT, MAX_POOL_CONNECTIONS File "/usr/local/lib/python3.7/site-packages/botocore/endpoint.py", line 22, in from botocore.awsrequest import create_request_object File "/usr/local/lib/python3.7/site-packages/botocore/awsrequest.py", line 25, in import botocore.utils File "/usr/local/lib/python3.7/site-packages/botocore/utils.py", line 30, in from urllib3.util.url import IPV6_ADDRZ_RE ImportError: cannot import name 'IPV6_ADDRZ_RE' from 'urllib3.util.url' (/usr/local/lib/python3.7/site-packages/urllib3/util/url.py)

sh-4.2$ pip3 list Package Version


awscli 1.18.163 boto3 1.16.3 botocore 1.19.3 certifi 2020.6.20 chardet 3.0.4 colorama 0.4.3 docutils 0.15.2 flake8 3.5.0 idna 2.7 jmespath 0.10.0 mccabe 0.6.1 pip 9.0.3 pyasn1 0.4.8 pycodestyle 2.3.1 pyflakes 1.6.0 python-dateutil 2.8.1 pytz 2018.5 PyYAML 5.3.1 requests 2.20.0 rsa 4.5 s3transfer 0.1.13 setuptools 38.4.0 six 1.15.0 SQLAlchemy 1.3.6 SQLAlchemy-Utils 0.33.3 urllib3 1.22

ean007 avatar Oct 22 '20 23:10 ean007

I believe this related to #211 and was fixed in #158. Please try pulling the latest version and reinstall the project requirements.

sebastian-mora avatar Nov 03 '20 21:11 sebastian-mora

@ean007 Did you get this worked out with this suggestion: https://github.com/RhinoSecurityLabs/pacu/issues/210#issuecomment-721392209 ?

DaveYesland avatar Mar 18 '21 16:03 DaveYesland