Print

Print


@simonmichal You're running into the equivalent of this https://floatingoctothorpe.uk/2016/python3-centos-and-pip.html because of CentOS packaging issues. You can see this with a minimal example of just trying to create a Python virtual environment, seeing it fail, and then running python3 -Im ensurepip --upgrade --default-pip directly

$ docker pull cern/cc7-base:latest
$ docker run -it --rm cern/cc7-base:latest /bin/bash
[root@5bd3a2fc06ee /]# yum install --nogpg -y git python3-pip which
[root@5bd3a2fc06ee /]# python3 -m pip install --upgrade pip
[root@5bd3a2fc06ee /]# python3 -m pip install --upgrade setuptools
[root@5bd3a2fc06ee /]# python3 -m pip list
Package    Version
---------- -------
pip        21.3.1
setuptools 59.6.0
[root@5bd3a2fc06ee /]# python3 -m venv venv
Error: Command '['/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
[root@5bd3a2fc06ee /]# python3 -Im ensurepip --upgrade --default-pip
Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib64/python3.6/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/usr/lib64/python3.6/ensurepip/__init__.py", line 232, in _main
    default_pip=args.default_pip,
  File "/usr/lib64/python3.6/ensurepip/__init__.py", line 129, in _bootstrap
    shutil.copy(whl, tmpdir)
  File "/usr/lib64/python3.6/shutil.py", line 245, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib64/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib64/python3.6/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl'

The short fix is just always update pip and setuptools as a group

python3 -m pip install --upgrade pip setuptools

so this works:

$ docker pull cern/cc7-base:latest
$ docker run -it --rm cern/cc7-base:latest /bin/bash
yum install --nogpg -y git python3-pip which
python3 -m pip install --upgrade pip setuptools wheel
git clone https://github.com/xrootd/xrootd
cd xrootd/
git fetch origin pull/1585/head:pr1585
git checkout pr1585
cp packaging/wheel/* .
./publish.sh

You can also remove the python3 -m pip install --upgrade commands and it will work fine:

$ docker pull cern/cc7-base:latest
$ docker run -it --rm cern/cc7-base:latest /bin/bash
yum install --nogpg -y git python3-pip which
git clone https://github.com/xrootd/xrootd
cd xrootd/
git fetch origin pull/1585/head:pr1585
git checkout pr1585
cp packaging/wheel/* .
./publish.sh

Aside: Why are you using cern/cc7-base:latest when it isn't used anywhere for testing in the repo?

$ git grep "cc7-base"
.github/workflows/build.yml:    container: gitlab-registry.cern.ch/linuxsupport/cc7-base:latest
.github/workflows/build.yml:    container: gitlab-registry.cern.ch/linuxsupport/cc7-base:latest
.github/workflows/build.yml:    container: gitlab-registry.cern.ch/linuxsupport/cc7-base:latest
.github/workflows/build.yml:    container: gitlab-registry.cern.ch/linuxsupport/cc7-base:latest
.github/workflows/build.yml:    container: gitlab-registry.cern.ch/linuxsupport/cc7-base:latest
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base
.gitlab-ci.yml:  image: gitlab-registry.cern.ch/linuxsupport/cc7-base


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <xrootd/xrootd/pull/1585/c1021344620@github.com>

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/pull/1585#issuecomment-1021344620", "url": "https://github.com/xrootd/xrootd/pull/1585#issuecomment-1021344620", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1