aws-ia / taskcat

Test all the CloudFormation things! (with TaskCat)
https://aws-ia.github.io/taskcat/
Apache License 2.0
1.17k stars 213 forks source link

Can't install taskcat 0.9.36 on redhat 7 #785

Closed YanFenGuo closed 2 months ago

YanFenGuo commented 1 year ago

Describe the bug Trying to install taskcat 0.9.36 but failed

To Reproduce Steps to reproduce the behavior:

[root@ocp1 operator]# python3 --version
Python 3.8.9

[root@ocp1 operator]# pip --version
pip 23.0.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

[root@ocp1 operator]# pip install taskcat
Collecting taskcat
  Using cached taskcat-0.9.36-py3-none-any.whl (121 kB)
Collecting reprint
  Using cached reprint-0.6.0-py2.py3-none-any.whl (6.0 kB)
Collecting botocore<2.0,>=1.12.21
  Using cached botocore-1.29.82-py3-none-any.whl (10.5 MB)
Requirement already satisfied: setuptools>=40.4.3 in /usr/local/lib/python3.8/site-packages (from taskcat) (49.2.1)
Collecting cfn-lint<1.0,>=0.13.0
  Using cached cfn_lint-0.74.0-py3-none-any.whl (3.0 MB)
Collecting requests>2.17.0
  Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting PyYAML~=5.1
  Using cached PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl (662 kB)
Collecting tabulate<1.0,>=0.8.2
  Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting jsonschema~=3.0
  Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting boto3<2.0,>=1.9.21
  Using cached boto3-1.26.82-py3-none-any.whl (134 kB)
Collecting docker~=4.0
  Using cached docker-4.4.4-py2.py3-none-any.whl (147 kB)
Collecting pathspec==0.10.3
  Using cached pathspec-0.10.3-py3-none-any.whl (29 kB)
Collecting markupsafe==2.0.1
  Using cached MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (from taskcat) (23.0.1)
Collecting yattag<2.0,>=1.10.0
  Using cached yattag-1.15.0.tar.gz (28 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[root@ocp1 operator]# pip install setuptools
Requirement already satisfied: setuptools in /usr/local/lib/python3.8/site-packages (49.2.1)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Expected behavior Can install taskcat 0.9.36

Additional context I install python 3.8 by source because can't find any repo which contains python 3.8.

  $  wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz
  $  tar xzvf Python-3.8.9.tgz
  $  cd Python-3.8.9
  $  ./configure --enable-optimizations
  $  make altinstall

Below is system info:

[root@ocp1 operator]# uname -a
Linux abc.fyre.ibm.com 3.10.0-1160.83.1.el7.x86_64 #1 SMP Mon Dec 19 10:44:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@ocp1 operator]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.9 (Maipo)
YanFenGuo commented 1 year ago

After do python3 -m pip install --upgrade pip setuptools wheel, I get below different error:

[root@ocp1 operator]# pip3 install taskcat
Collecting taskcat
  Using cached taskcat-0.9.36-py3-none-any.whl (121 kB)
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (from taskcat) (23.0.1)
Collecting cfn-lint<1.0,>=0.13.0
  Using cached cfn_lint-0.74.0-py3-none-any.whl (3.0 MB)
Collecting yattag<2.0,>=1.10.0
  Using cached yattag-1.15.0.tar.gz (28 kB)
  Preparing metadata (setup.py) ... done
Collecting botocore<2.0,>=1.12.21
  Using cached botocore-1.29.82-py3-none-any.whl (10.5 MB)
Collecting markupsafe==2.0.1
  Using cached MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Collecting jsonschema~=3.0
  Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
Collecting docker~=4.0
  Using cached docker-4.4.4-py2.py3-none-any.whl (147 kB)
Collecting dulwich~=0.19
  Using cached dulwich-0.21.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (508 kB)
Collecting PyYAML~=5.1
  Using cached PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl (662 kB)
Collecting dataclasses-jsonschema<2.15.2,>=2.9.0
  Using cached dataclasses_jsonschema-2.15.1-py3-none-any.whl (17 kB)
Collecting boto3<2.0,>=1.9.21
  Using cached boto3-1.26.82-py3-none-any.whl (134 kB)
Collecting requests>2.17.0
  Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting pathspec==0.10.3
  Using cached pathspec-0.10.3-py3-none-any.whl (29 kB)
Collecting jinja2<4.0,>=3.1.1
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Requirement already satisfied: setuptools>=40.4.3 in /usr/local/lib/python3.8/site-packages (from taskcat) (67.4.0)
Collecting tabulate<1.0,>=0.8.2
  Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting reprint
  Using cached reprint-0.6.0-py2.py3-none-any.whl (6.0 kB)
Collecting s3transfer<0.7.0,>=0.6.0
  Downloading s3transfer-0.6.0-py3-none-any.whl (79 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.6/79.6 kB 1.1 MB/s eta 0:00:00
Collecting jmespath<2.0.0,>=0.7.1
  Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
Collecting urllib3<1.27,>=1.25.4
  Downloading urllib3-1.26.14-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 1.4 MB/s eta 0:00:00
Collecting python-dateutil<3.0.0,>=2.1
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 2.9 MB/s eta 0:00:00
Collecting sarif-om~=1.0.4
  Downloading sarif_om-1.0.4-py3-none-any.whl (30 kB)
Collecting jsonpatch
  Downloading jsonpatch-1.32-py2.py3-none-any.whl (12 kB)
Collecting aws-sam-translator>=1.59.0
  Downloading aws_sam_translator-1.60.1-py3-none-any.whl (282 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 282.4/282.4 kB 1.4 MB/s eta 0:00:00
Collecting jschema-to-python~=1.2.3
  Downloading jschema_to_python-1.2.3-py3-none-any.whl (10 kB)
Collecting networkx<4,>=2.4
  Downloading networkx-3.0-py3-none-any.whl (2.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 707.7 kB/s eta 0:00:00
Collecting junit-xml~=1.9
  Downloading junit_xml-1.9-py2.py3-none-any.whl (7.1 kB)
Collecting six>=1.4.0
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting websocket-client>=0.32.0
  Downloading websocket_client-1.5.1-py3-none-any.whl (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.9/55.9 kB 905.8 kB/s eta 0:00:00
Collecting attrs>=17.4.0
  Downloading attrs-22.2.0-py3-none-any.whl (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.0/60.0 kB 927.3 kB/s eta 0:00:00
Collecting pyrsistent>=0.14.0
  Downloading pyrsistent-0.19.3-py3-none-any.whl (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.5/57.5 kB 934.0 kB/s eta 0:00:00
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 195.4/195.4 kB 954.1 kB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 1.1 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 1.0 MB/s eta 0:00:00
Collecting colorama
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting backports.shutil-get-terminal-size
  Downloading backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl (6.5 kB)
Collecting typing-extensions~=4.4.0
  Downloading typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Collecting jsonpickle
  Downloading jsonpickle-3.0.1-py2.py3-none-any.whl (40 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.5/40.5 kB 1.1 MB/s eta 0:00:00
Collecting pbr
  Downloading pbr-5.11.1-py2.py3-none-any.whl (112 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 112.7/112.7 kB 1.1 MB/s eta 0:00:00
Collecting jsonpointer>=1.9
  Downloading jsonpointer-2.3-py2.py3-none-any.whl (7.8 kB)
Building wheels for collected packages: yattag
  Building wheel for yattag (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [32 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-quvb0htc/yattag_eb47825f084f4e72b387d3aa02a6d509/setup.py", line 6, in <module>
          setup(
        File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 172, in setup
          ok = dist.parse_command_line()
        File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 475, in parse_command_line
          args = self._parse_command_opts(parser, args)
        File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 1119, in _parse_command_opts
          nargs = _Distribution._parse_command_opts(self, parser, args)
        File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 534, in _parse_command_opts
          cmd_class = self.get_command_class(command)
        File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 966, in get_command_class
          self.cmdclass[command] = cmdclass = ep.load()
        File "/usr/local/lib/python3.8/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 208, in load
          module = import_module(match.group('module'))
        File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
        File "<frozen importlib._bootstrap>", line 991, in _find_and_load
        File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 783, in exec_module
        File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
        File "/usr/local/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 28, in <module>
          from .macosx_libfile import calculate_macosx_platform_tag
        File "/usr/local/lib/python3.8/site-packages/wheel/macosx_libfile.py", line 43, in <module>
          import ctypes
        File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
          from _ctypes import Union, Structure, Array
      ModuleNotFoundError: No module named '_ctypes'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for yattag
  Running setup.py clean for yattag
Failed to build yattag
Installing collected packages: yattag, charset-normalizer, backports.shutil-get-terminal-size, websocket-client, urllib3, typing-extensions, tabulate, six, PyYAML, pyrsistent, pbr, pathspec, networkx, markupsafe, jsonpointer, jsonpickle, jmespath, idna, colorama, certifi, attrs, sarif-om, requests, reprint, python-dateutil, junit-xml, jsonschema, jsonpatch, jschema-to-python, jinja2, dulwich, docker, dataclasses-jsonschema, botocore, s3transfer, boto3, aws-sam-translator, cfn-lint, taskcat
  Running setup.py install for yattag ... done
  DEPRECATION: yattag was installed using the legacy 'setup.py install' method, because a wheel could not be built for it. pip 23.1 will enforce this behaviour change. A possible replacement is to fix the wheel build issue reported above. Discussion can be found at https://github.com/pypa/pip/issues/8368
Successfully installed PyYAML-5.4.1 attrs-22.2.0 aws-sam-translator-1.60.1 backports.shutil-get-terminal-size-1.0.0 boto3-1.26.82 botocore-1.29.82 certifi-2022.12.7 cfn-lint-0.74.0 charset-normalizer-3.0.1 colorama-0.4.6 dataclasses-jsonschema-2.15.1 docker-4.4.4 dulwich-0.21.3 idna-3.4 jinja2-3.1.2 jmespath-1.0.1 jschema-to-python-1.2.3 jsonpatch-1.32 jsonpickle-3.0.1 jsonpointer-2.3 jsonschema-3.2.0 junit-xml-1.9 markupsafe-2.0.1 networkx-3.0 pathspec-0.10.3 pbr-5.11.1 pyrsistent-0.19.3 python-dateutil-2.8.2 reprint-0.6.0 requests-2.28.2 s3transfer-0.6.0 sarif-om-1.0.4 six-1.16.0 tabulate-0.9.0 taskcat-0.9.36 typing-extensions-4.4.0 urllib3-1.26.14 websocket-client-1.5.1 yattag-1.15.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Still not work

[root@ocp1 operator]# taskcat --version
Traceback (most recent call last):
  File "/usr/local/bin/taskcat", line 4, in <module>
    from taskcat._cli import main
  File "/usr/local/lib/python3.8/site-packages/taskcat/__init__.py", line 4, in <module>
    from ._cfn.stack import Stack  # noqa: F401
  File "/usr/local/lib/python3.8/site-packages/taskcat/_cfn/stack.py", line 16, in <module>
    from taskcat._cfn.template import Template, tcat_template_cache
  File "/usr/local/lib/python3.8/site-packages/taskcat/_cfn/template.py", line 9, in <module>
    import cfnlint
  File "/usr/local/lib/python3.8/site-packages/cfnlint/__init__.py", line 7, in <module>
    import cfnlint.conditions
  File "/usr/local/lib/python3.8/site-packages/cfnlint/conditions.py", line 10, in <module>
    import cfnlint.helpers
  File "/usr/local/lib/python3.8/site-packages/cfnlint/helpers.py", line 24, in <module>
    from cfnlint.decode.node import dict_node, list_node, str_node
  File "/usr/local/lib/python3.8/site-packages/cfnlint/decode/__init__.py", line 15, in <module>
    from cfnlint.rules import Match, ParseError
  File "/usr/local/lib/python3.8/site-packages/cfnlint/rules/__init__.py", line 16, in <module>
    from cfnlint.template import Template
  File "/usr/local/lib/python3.8/site-packages/cfnlint/template.py", line 12, in <module>
    from cfnlint.graph import Graph
  File "/usr/local/lib/python3.8/site-packages/cfnlint/graph.py", line 12, in <module>
    import networkx
  File "/usr/local/lib/python3.8/site-packages/networkx/__init__.py", line 19, in <module>
    from networkx import utils
  File "/usr/local/lib/python3.8/site-packages/networkx/utils/__init__.py", line 2, in <module>
    from networkx.utils.decorators import *
  File "/usr/local/lib/python3.8/site-packages/networkx/utils/decorators.py", line 1, in <module>
    import bz2
  File "/usr/local/lib/python3.8/bz2.py", line 19, in <module>
    from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
YanFenGuo commented 1 year ago

As an update, things goes well on redhat 8.