MicroStrategy / mstrio-py

Python integration for MicroStrategy
Apache License 2.0
90 stars 60 forks source link

AttributeError: module 'setuptools.dist' has no attribute 'pkg_resources' #142

Closed juliankeppel closed 1 year ago

juliankeppel commented 1 year ago

Hello,

My environment: MacOS 13.4.1 with Apple M1 chip Python 3.8 and 3.9 Poetry 1.5.1 Pip 23.2 Setuptools 68.0.0

I would like to use mstrio-py on a Hadoop cluster running Python 3.8 or 3.9. Unfortunately, I have no control over the Python versions. Therefore, I tried to find out which is the latest possible mstrio-py version that supports Python3.8 (11.3.4.101) or Python3.9 (11.3.5.103).

I am using poetry for dependency management. Poetry uses pip in the background, and when installing mstrio-py I get the following error message (both in poetry, and when I run a plain pip install):

python3.8 -m pip install mstrio-py==11.3.4.101 -->

Collecting mstrio-py==11.3.5.103
  Using cached mstrio-py-11.3.5.103.tar.gz (1.3 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/mb/dxpgw0h53dq5phfmgs6b5yqm0000gq/T/pip-install-31lxjk60/mstrio-py_f5b76b84bad4462a87db9ce4ec4ffb6b/setup.py", line 18, in <module>
          dist.pkg_resources.safe_version = lambda v: v
      AttributeError: module 'setuptools.dist' has no attribute 'pkg_resources'
      [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.

With python3.9 the same error occurs.

I have already tried upgrading pip and setuptools with pip install --upgrade pip setuptools.

Can anyone help me with this problem?

mstrpr commented 1 year ago

@juliankeppel Those versions of mstrio-py require setuptools in version less than 67.0

juliankeppel commented 1 year ago

@mstrpr Thank you very much for this fast answer.

Putting setuptools = "<67.0" to my dependencies helped!

I now have another problem with very old pandas/numpy versions incompatible with the rest of the project, but that's noting directly related to mstrio.

So from my point of view we can close this issue.

apiotrowskiMicroStrategy commented 1 year ago

When "playing around" with setuptools, it is a known issue that numpy with "incorrect" version may fail, so try to meet versioning of those two based on for example date of release.

Either way, closing as "not mstrio-py related".