st2client could not be installed when setuptools>=50.0.0

Created on 7 Sep 2020  路  9Comments  路  Source: StackStorm/st2

SUMMARY

Provide a quick summary of your bug report.

STACKSTORM VERSION

not relevant

OS, environment, install method

not relevant

Steps to reproduce the problem

  1. run python image -> docker run --rm -it --entrypoint=sh python:3.7
  2. install setuptools>=50.0.0 pip install setuptools>=50.0.0
  3. try to install st2client in the container pip install st2client==3.2.0

however, when setuptools<50.0.0 was installed, st2client can be installed.

Expected Results

exceted st2client can be installed.

Actual Results

error occurs when installing

# pip install st2client==3.2.0
Collecting st2client==3.2.0
  Downloading st2client-3.2.0.tar.gz (104 kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 104 kB 134 kB/s
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f4z91qt3/st2client/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f4z91qt3/st2client/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-o1xxfeb4
         cwd: /tmp/pip-install-f4z91qt3/st2client/
    Complete output (17 lines):
    /usr/local/lib/python3.7/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
      warnings.warn("Setuptools is replacing distutils.")
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-f4z91qt3/st2client/setup.py", line 63, in <module>
        'st2 = st2client.shell:main'
      File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 152, in setup
        _install_setup_requires(attrs)
      File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in _install_setup_requires
        dist.parse_config_files(ignore_option_errors=True)
      File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 665, in parse_config_files
        self._parse_config_files(filenames=filenames)
      File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 572, in _parse_config_files
        filenames = self.find_config_files()
      File "/usr/local/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 353, in find_config_files
        sys_dir = os.path.dirname(sys.modules['distutils'].__file__)
    KeyError: 'distutils'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
bug good first issue help wanted

All 9 comments

@LeoQuote Thanks for the report!
We've heard new setuptools v50 broke a lot of things recently https://github.com/pypa/setuptools/issues/2350

However having st2client working in that environment would be just a matter of time requirement.
If anyone wants to work on that, - this is a good first issue, help wanted.

I'll pick this up early next week. 馃憤

Seems to be working now with 50.3.2!
Screenshot 2020-10-24 at 09 56 18

@eliottha Thanks for trying and reporting back, that's helpful!

Cross-referencing related issue: https://github.com/StackStorm/st2/issues/5060

Yes, can confirm that the pip update did it and it works now. Great!

Hello, i have opened https://github.com/StackStorm/st2-dockerfiles/pull/42 which updates to latest pip when creating the docker image

@kroustou Thanks for the PR.

We however can't do that in Docker image only as other installers will still rely on a older pip version and setuptools which will lead to inconsistency issues between the environments and eventually bugs.

Instead of that, we'll need to change the pip/setuptools globally for stackstorm in core st2 repository requirements. That will then build the deb/rpm artifacts with the specified versions of tools.

See:
https://github.com/StackStorm/st2/blob/aa040bf7a8d7be6167569237abcd5bc40a02b2e5/fixed-requirements.txt#L47-L48
Then virtualenv package comes with the pinned versions of setuptools and pip, See https://virtualenv.pypa.io/en/latest/changelog.html for more info about version associations.

@armab thanks for the info - updated accordingly on https://github.com/StackStorm/st2/pull/5094

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tonybaloney picture tonybaloney  路  3Comments

pietervogelaar picture pietervogelaar  路  5Comments

trstruth picture trstruth  路  3Comments

srimandaleeka01 picture srimandaleeka01  路  5Comments

pietervogelaar picture pietervogelaar  路  4Comments