I am trying to install molecule into my docker image's python, so that I can run molecule test. I am using a Dockerfile to build the Docker image.
Running:
RUN pip install molecule
Yields:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xgVCo_/molecule/
According to https://github.com/facebook/prophet/issues/418 I should run pip install --upgrade setuptools
Running: pip install --upgrade setuptools
Yields:
   Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "setuptools/__init__.py", line 16, in <module>
        import setuptools.version
      File "setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "pkg_resources/__init__.py", line 1367
        raise SyntaxError(e) from e
                                ^
    SyntaxError: invalid syntax
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-RgmKVK/setuptools/
According to https://askubuntu.com/questions/975523/pip-install-gives-command-python-setup-py-egg-info-failed-with-error-code-1 I should run pip install --upgrade pip
Running:
pip install --upgrade pip
Yields:
      File "/tmp/pip-build-bSVCpL/pip/setup.py", line 7
        def read(rel_path: str) -> str:
                         ^
    SyntaxError: invalid syntax
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-bSVCpL/pip/
So how do I resolve this?
Dockerfile is based on CentOS7.
Current process:
#Install Molecule
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install setuptools-scm
RUN pip install molecule
Any help appreciated.