Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing build and installation steps without using pip #3265

Open
jkr0103 opened this issue May 23, 2024 · 1 comment
Open

Missing build and installation steps without using pip #3265

jkr0103 opened this issue May 23, 2024 · 1 comment

Comments

@jkr0103
Copy link

jkr0103 commented May 23, 2024

I could not find the steps/documentation to build and install the docker sdk for python without using pip. I felt this requirement on Ubuntu 24.04 where a simple script just having two lines doesn't wrok.
client.py:

start of client.py

import docker;
client = docker.from_env()

end of client.py

Issue is described here and fixed in version 6.1.0 with PR 3116.

Ubuntu 24.04 have following versions of python3-requests, python3-urllib3 and python3-docker packages:

$ apt list --installed | grep python3-urllib3
python3-urllib3/noble,now 2.0.7-1 all [installed,automatic]

$ apt list --installed | grep python3-requests
python3-requests/noble,now 2.31.0+dfsg-1ubuntu1 all [installed,automatic]

intel@gramine2404:~/docker-7.0.0$  apt list --installed | grep python3-docker
python3-docker/noble,now 5.0.3-1ubuntu1 all [installed]

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

Installing docker using pip is not the option on Ubuntu 24.04:

$ pip3 install docker
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Hence I am left with no option except manually building and installing the package. I am looking for the steps to build and install it manually.

Also I would like to know the way to request Ubuntu 24.04 community to upgrade python3-docker=5.0.3 to python3-docker>=6.1.0 where the compatibility issue with requests and urllib3 is fixed.

@akx
Copy link
Contributor

akx commented Sep 4, 2024

The externally-managed-environment error message outlines your options, and only the virtualenv option applies here (since this is a library, not an application).

If your project needs a version of docker-py other than that packaged by your distribution, use a virtualenv for your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants