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

pip editable modules incorrectly installed when setuptools>=60.0.0 #11189

Closed
1 task done
IgnacioHeredia opened this issue Jun 15, 2022 · 1 comment
Closed
1 task done
Labels
resolution: wrong project Should be reported elsewhere

Comments

@IgnacioHeredia
Copy link

IgnacioHeredia commented Jun 15, 2022

Description

Hi all,

I found a bug in Ubuntu 20.04 related to pip and setuptools.

When you pip install a Python module in Ubuntu 20.04 in editable mode (-e flag), the module is not listed in pip.
When the module is installed normally (no -e flag), everything works as usual, and pip finds the module.

This happens because depending on the setuptools version, the module is installed at a different path (and thus not found in the PYTHONPATH in some cases):

  • setuptools 45.2.0 works fine
    Module installation path: /usr/local/lib/python3.8/dist-packages/
$ python3 -c "import sys; print(sys.path)"
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/samplemod', '/usr/lib/python3/dist-packages']
  • setuptools 62.4.0 breaks
    Module installation path: /usr/lib/python3.8/site-packages/
$ python3 -c "import sys; print(sys.path)"
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']

The last working version is setuptools==59.8.0. Starting from setuptools==60.0.0 it breaks.

Expected behavior

The module should be correctly installed and listed.

$ pip3 list -e
Package Version Editable project location
------- ------- -------------------------
sample  0.1.0   /samplemod

pip version

22.1.2

Python version

3.8.10

OS

Ubuntu 20.04

How to Reproduce

I attach a minimal Dockerfile to reproduce the issue.

FROM ubuntu:20.04

# Refresh cache and install packages
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    apt-get install -y --no-install-recommends git

# Install pip
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip
RUN pip install --upgrade setuptools  # THIS BREAKS THE INSTALLATION: setuptools 45.2.0 -->  setuptools 62.4.0
RUN pip install --upgrade pip  # pip 20.0.2 -->  pip 22.1.2

# Install sample Python module in **editable** (-e) mode
RUN git clone https://github.com/navdeep-G/samplemod && \
    cd  samplemod && \
    pip install -v -e . && \
    cd ..

# Check behaviour
RUN python3 --version
RUN pip --version
RUN pip list -e
RUN python3 -c "import sys; print(sys.path)"

Output

  • setuptools 45.2.0 ✔️
Python 3.8.10
pip 22.1.2 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)

Pip install log:
[...] Creating /usr/local/lib/python3.8/dist-packages/sample.egg-link

$ pip3 list -e
Package Version Editable project location
------- ------- -------------------------
sample  0.1.0   /samplemod
  • setuptools 62.4.0 ❌
Python 3.8.10
pip 22.1.2 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)

pip install logs:
[...] Creating /usr/lib/python3.8/site-packages/sample.egg-link (link to .)

$ pip3 list -e

Code of Conduct

@IgnacioHeredia IgnacioHeredia added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jun 15, 2022
@IgnacioHeredia IgnacioHeredia changed the title pip editable modules not listed in Ubuntu 20.04 Docker image pip editable modules incorrectly installed for some setuptools versions Jun 15, 2022
@IgnacioHeredia IgnacioHeredia changed the title pip editable modules incorrectly installed for some setuptools versions pip editable modules incorrectly installed for setuptools>=60.0.0 Jun 15, 2022
@IgnacioHeredia IgnacioHeredia changed the title pip editable modules incorrectly installed for setuptools>=60.0.0 pip editable modules incorrectly installed when setuptools>=60.0.0 Jun 15, 2022
@uranusjr
Copy link
Member

This should be reported to setuptools instead.

@uranusjr uranusjr closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2022
@uranusjr uranusjr added resolution: wrong project Should be reported elsewhere and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Jun 15, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: wrong project Should be reported elsewhere
Projects
None yet
Development

No branches or pull requests

2 participants