WebexPythonSDK icon indicating copy to clipboard operation
WebexPythonSDK copied to clipboard

Errors due to the required module "future"

Open barryqy opened this issue 2 years ago • 1 comments

I was trying to do pip install of webexteamssdk on an alpine linux docker, kept getting errors due to the required module "future" pip version is 22.1.2 and python version is 3.9

      AttributeError: 'Distribution' object has no attribute 'convert_2to3_doctests'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for future
  Running setup.py clean for future
Failed to build future
Installing collected packages: future
  Running setup.py install for future ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for future did not run successfully.
  │ exit code: 1
  ╰─> [276 lines of output]
…
      AttributeError: 'Distribution' object has no attribute 'convert_2to3_doctests'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> future

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

barryqy avatar Jun 27 '22 13:06 barryqy

Alpine is based on the musl toolchain, and most Python pre-built binary wheel packages (like python-future) don't publish compatible packages to PyPI (some discussion here: https://discuss.python.org/t/wheels-for-musl-alpine/7084/3). It seems Alpine has a pre-buillt native package that delivers python-future, which you can try installing: https://pkgs.alpinelinux.org/package/edge/main/x86/py3-future Otherwise you may need to pursue how to get all of the setup.py build dependencies for python-future (and likely many other Python packages) into your container so the pip-driven build-from-scratch can work (and is outside the scope of this project). From my experience I can validate what seems like a widespread opinion that Alpine is a pretty bad platform for Python projects of any complexity: https://pythonspeed.com/articles/alpine-docker-python/. Also from my experience, once you install Python3 and needed dependencies, any space saved by using Alpine (instead of e.g. Ubuntu) is moot or even negative...

dstaudt avatar Jun 27 '22 23:06 dstaudt