amazonlinux / amazon-linux-2023

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

[Bug] - Add Package `python3-docker` #780

Open driverpt opened 3 months ago

driverpt commented 3 months ago

Describe the bug

Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on <hostname>'s Python /usr/bin/python. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: cannot import name '__version__' from 'docker' (unknown location)

To Reproduce Steps to reproduce the behavior:

  1. Install Ansible
  2. Try to deploy something on Docker or Docker Swarm via Ansible

Packages list:

  1. sudo dnf install python3-requests
  2. pip install docker

Expected behavior To be able to deploy without an issue

Screenshots N/A

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context N/A

zcobol commented 3 months ago

@driverpt python3 -m pip install docker works, until an rpm package will be provided! More info at https://pypi.org/project/docker/

driverpt commented 3 months ago

Doesn't work for me. It says that python-requests was already installed externally via rpm

ozbenh commented 3 months ago

I have it installing (I didn't try using it) doing:

sudo dnf install python3-botocore-1.33.6-1.amzn2023.0.1.noarch
pip install -U docker

I used the specific botocore version here because of a bug in our current repos where trying to install botocore without an explicit version downgrades awscli instead and generally makes a mess of things (https://github.com/amazonlinux/amazon-linux-2023/issues/704), but once that is fixed, just installing botocore from dnf should do the job too

ozbenh commented 1 week ago

Note the bug with botocore has been fixed for a while