amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
523 stars 39 forks source link

[Bug] - Python botocore is not in Python Path #518

Closed kivengh closed 9 months ago

kivengh commented 11 months ago

Describe the bug Python3 botocore module provided by awscli cannot be imported as module in system Python3.9.

To Reproduce Steps to reproduce the behavior:

  1. Install python3-botocore (provided by awscli-2) : dnf install python3-botocore
  2. Launch a Python interpreter : python3
  3. try to import botocore: >>> import botocore
  4. Cant import botocore module >>> import botocore Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'botocore'

Expected behavior Botocore should be available for Python interpreter, as it is provided as a system package.

Additional context The botocore module is not installed in "/usr/lib/python3.9/site-packages", but in "/usr/lib/python3.9/site-packages/awscli".

It will be great if you can provide a separate package for python-botocore or make botocore accessible to system python.

stewartsmith commented 11 months ago

This is a packaging bug. What should be occurring is that the awscli package has its own embedded botocore as awscli.botocore, and a separate package providing botocore for use by other packages.

nmeyerhans commented 11 months ago

A fix for this is in the works. We don't have an ETA for it, but it'll be included in an upcoming AL2023 release.

nkadel commented 10 months ago

Embedding python modules inside other packages is nearly always a very, very bad idea. Please update them together but segregate them entirely.

nmeyerhans commented 10 months ago

@nkadel awscli upstream has essentially re-absorbed what amounts to a fork of botocore. This was an intentional decision by the CLI developers. The packaging issue here is that the cli declares a Provides: python3-botocore, which is wrong. The solution will be to provide both botocore and boto3 as standalone packages, and fix the awscli package to drop the Provides. The work on this is mostly done and I expect that it'll be included in the next scheduled AL2023 release.

nmeyerhans commented 9 months ago

Done as of the AL2023.3 release just published.