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 install fails with .../python3: can't find '__main__' module in '.../pep517/_in_process.py #7946

Closed
lazka opened this issue Mar 31, 2020 · 5 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@lazka
Copy link
Contributor

lazka commented Mar 31, 2020

Environment

  • pip version: 20.0.2
  • Python version: 3.8.2
  • OS: Ubuntu 20.04 and Debian testing/sid

Description

Sometime during the last week or two installing pygobject with pip has started to fail with (full log at the bottom):

python3: can't find '__main__' module in '/home/lazka/Desktop/git/pygobject/_venv/share/python-wheels/pep517-0.7.0-py2.py3-none-any.whl/pep517/_in_process.py'

This is before any of my setup.py code is executed so I don't know what is going on.

The only workaround I found so far is removing the "pyproject.toml" file which currently contains this:

[build-system]
requires = ["setuptools", "wheel", "pycairo"]

Expected behavior

pip install succeeds like it did before

How to Reproduce

  • In a venv install pygobject: pip install pygobject
  • Note that this needs some system packages on Debian/Ubuntu: sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev

Output

> pip install .
Processing /home/lazka/Desktop/git/pygobject
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /home/lazka/Desktop/git/pygobject/_venv/bin/python3 /home/lazka/Desktop/git/pygobject/_venv/share/python-wheels/pep517-0.7.0-py2.py3-none-any.whl/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpopma5aoh
       cwd: /tmp/pip-req-build-htjk5uuc
  Complete output (1 lines):
  /home/lazka/Desktop/git/pygobject/_venv/bin/python3: can't find '__main__' module in '/home/lazka/Desktop/git/pygobject/_venv/share/python-wheels/pep517-0.7.0-py2.py3-none-any.whl/pep517/_in_process.py'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /home/lazka/Desktop/git/pygobject/_venv/bin/python3 /home/lazka/Desktop/git/pygobject/_venv/share/python-wheels/pep517-0.7.0-py2.py3-none-any.whl/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpopma5aoh Check the logs for full command output.
@lazka
Copy link
Contributor Author

lazka commented Mar 31, 2020

I've created a minimal reproducer: https://github.com/lazka/pip-pyproject-bug

Just a basic pyproject.toml fails. I wonder why I'm the first to hit this, hm.

@lazka
Copy link
Contributor Author

lazka commented Mar 31, 2020

Another data point: This doesn't fail on Arch Linux with the same pip/python, so might be a Debian only issue.

@lazka
Copy link
Contributor Author

lazka commented Mar 31, 2020

Turns out forcing a pip install with "--force-reinstall" in the venv makes things work, so this is a broken pip in Debian which was also pulled into Ubuntu. I'll report this to Debian instead.

@lazka lazka closed this as completed Mar 31, 2020
@uranusjr
Copy link
Member

Looks similar to #7874 (see sqlalchemy/sqlalchemy#5207). This is indeed a Debian issue, they patch parts of the Python standard distribution that makes PEP 517 fail. Please definitely report this to Debian; they are in the best position to fix this.

In the mean time, there are workarounds in the linked issues to avoid force-reinstall pip.

@lazka
Copy link
Contributor Author

lazka commented Mar 31, 2020

I've reported it to Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955414

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 5, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label May 5, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants