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

Unable to install debugpy using poetry v1.4.1 #1246

Closed
steve-marmalade opened this issue Mar 19, 2023 · 31 comments
Closed

Unable to install debugpy using poetry v1.4.1 #1246

steve-marmalade opened this issue Mar 19, 2023 · 31 comments
Assignees
Labels
bug Something isn't working P1

Comments

@steve-marmalade
Copy link

steve-marmalade commented Mar 19, 2023

Before creating a new issue, please check the FAQ to see if your question is answered there.

Environment data

  • debugpy version: 1.6.6
  • OS and version: Arch Linux 6.2.6-arch1-1
  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.1
  • Using VS Code or Visual Studio: No

Actual behavior

Running poetry add debugpy crashes with a _WheelFileValidationError

Expected behavior

It installs successfully, just as it does with pip install debugpy

Steps to reproduce:

  1. Install Poetry v1.4.1 (I used the pipx method)
  2. mkdir poetry-test && cd poetry-test
  3. poetry init
  4. poetry add debugpy

Given that this issue is present when installing via poetry but not pip, I initially created the issue in python-poetry/poetry#7686, but the maintainers have directed me to open an issue here to investigate the invalid wheel.

@twam
Copy link

twam commented Mar 20, 2023

Same issue here on macOS 13.2.1 with Python 3.11.2.

@nrontsis
Copy link

nrontsis commented Mar 20, 2023

Same issue when running poetry in a Docker environment (latest python:3.11-slim)

@jaidisido
Copy link

Same issue on AWS arm64 docker python3.9 image

@piiq
Copy link

piiq commented Mar 20, 2023

Working on an m1 macbook.

It seems that poetry 1.4.1 that was released yesterday introduced a couple of regressions. The one mentioned in this issue (_WheelValidationError) and inability to install some packages with a correct md5 wheel hash.

Downgrading poetry to 1.4.0 made the errors go away for me. Hope this helps.

@DanInacio
Copy link

DanInacio commented Mar 20, 2023

Had the same issue when installing torch in a Python3.8 environment on a Remote Runner via Github Actions.
Can confirm downgrading Poetry to v1.4.0 solved the problem.

@hr-curtissimo
Copy link

hr-curtissimo commented Mar 20, 2023

Confirm that it happens in the following with all versions of Python 3.9+:

  • Windows 11 with poetry 1.4.1
  • macOS 12.6.3, 13.2.1 with poetry 1.4.1
  • Debian Bullseye with poetry 1.4.1
In /.../.cache/poetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl,
hash / size of debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.cp39-win_amd64.pyd didn't match RECORD

In /.../.cache/poetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl,
hash / size of debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.cp39-win_amd64.pyd didn't match RECORD

In /.../.cache/poetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl,
hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll didn't match RECORD

In /.../.cache/poetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl,
hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll didn't match RECORD

In /.../.cache/poetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl,
hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe didn't match RECORD

In /.../.cache/poetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl,
hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe didn't match RECORD

In /.../.cache/poetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl,
hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll didn't match RECORD

In /.../.cache/poetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl,
hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll didn't match RECORD

@gazorby
Copy link

gazorby commented Mar 20, 2023

The workaround when using poetry 1.4.1 is to set installer.modern-installation setting to false

mtucker added a commit to mtucker/langchain that referenced this issue Mar 20, 2023
When following the Quick Start instructions in the contributing docs, I was getting a "WheelFileValidationError" on installation of debugpy
which was blocking the installation of a number of other deps. Google turned up this [GitHub issue](microsoft/debugpy#1246)
indicating a regression in Poetry 1.4.1 and workarounds.
hwchase17 pushed a commit to langchain-ai/langchain that referenced this issue Mar 21, 2023
When following the Quick Start instructions in the contributing docs, I
was getting a "WheelFileValidationError" on installation of debugpy
which was blocking the installation of a number of other deps. Google
turned up this [GitHub
issue](microsoft/debugpy#1246) indicating a
regression in Poetry 1.4.1 and workarounds.

This PR updates the contrib docs noting the issue and the workarounds.
@yash2tailorbird
Copy link

The workaround when using poetry 1.4.1 is to set installer.modern-installation setting to false

it worked. thanks !

@Topchaniuk
Copy link

installer.modern-installation - where I can find this setting? Is it in VS Code settings or poetry?

@lifehackett
Copy link

installer.modern-installation - where I can find this setting? Is it in VS Code settings or poetry?

poetry config installer.modern-installation false

@yash2tailorbird
Copy link

installer.modern-installation - where I can find this setting? Is it in VS Code settings or poetry?

RUN poetry config installer.modern-installation false in your terminal

@Topchaniuk
Copy link

@yash2tailorbird that helped, thank you!

@onuralpszr
Copy link

Is it better practice to set installer.modern-installation or to just downgrade to poetry 1.4.1 until the issue is fixed?

For the first part it is not good practive. Secondly If you really need latest version of debugpy via poetry you can downgrade or just turn off certain setting, but that does not the fix actual problem.

@scholarazwa
Copy link

Same issue. Tried to install jupyterlab and it stops at installing debugpy:

 • Installing debugpy (1.6.6): Failed

  _WheelFileValidationError

  ["In /Users/scholarazwa/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.cp39-win_amd64.pyd didn't match RECORD", "In /Users/scholarazwa/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.cp39-win_amd64.pyd didn't match RECORD", "In /Users/scholarazwa/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll didn't match RECORD", "In /Users/scholarazwa/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll didn't match RECORD", "In /Users/scholarazwa/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe didn't match RECORD", "In /Users/scholarazwa/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe didn't match RECORD", "In /Users/scholarazwa/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll didn't match RECORD", "In /Users/scholarazwa/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll didn't match RECORD"]

  at ~/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/installer/sources.py:289 in validate_record
      285│                         f"In {self._zipfile.filename}, hash / size of {item.filename} didn't match RECORD"
      286│                     )
      287│ 
      288│         if issues:
    → 289│             raise _WheelFileValidationError(issues)
      290│ 
      291│     def get_contents(self) -> Iterator[WheelContentElement]:
      292│         """Sequential access to all contents of the wheel (including dist-info files).
      293│ 


@fredrikaverpil
Copy link

fredrikaverpil commented Mar 29, 2023

For anyone using poetry with GitHub Actions:

- run: echo "POETRY_VERSION=$(poetry --version)" >> $GITHUB_ENV
  shell: bash

- run: poetry config installer.modern-installation false
  # workaround for bug: https://github.com/microsoft/debugpy/issues/1246
  if: ${{ contains(env.POETRY_VERSION, '1.4.1') }}
  shell: bash

@steve-marmalade
Copy link
Author

While the workarounds are useful to unblock end-users in the short-run, have the maintainers of this repo confirmed whether the debugpy wheel is indeed invalid and, if so, scoped the work to resolve it?

@int19h
Copy link
Contributor

int19h commented Mar 29, 2023

The files affected are all Win32 binaries that undergo signing in the process of building the official wheels, and need to be re-hashed after that. It seems that this process is broken currently. This is definitely a high-priority issue, and we're investigating.

@lkurija1
Copy link

lkurija1 commented Apr 3, 2023

Works with the new v1.4.2 poetry

@martinmiglio
Copy link

Works with the new v1.4.2 poetry

But with a warning, per poetry's release notes:

When trying to install wheels with invalid RECORD files, Poetry does not fail anymore but only prints a warning.

@int19h
Copy link
Contributor

int19h commented Apr 3, 2023

Root cause has been identified; a new build of debugpy with fixed hashes is coming shortly.

greenmmq added a commit to jogoodma/homology-explorer that referenced this issue Apr 4, 2023
@tianhuil
Copy link

tianhuil commented Apr 4, 2023

Thank you @int19h !

@drorata
Copy link

drorata commented Apr 5, 2023

Works with the new v1.4.2 poetry

For me it doesn't work. I have to configure poetry config installer.modern-installation false first. Otherwise, I still get the error:

_WheelFileValidationError

  ["In /Users/fooboo/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.cp39-win_amd64.pyd didn't match RECORD", "In /Users/fooboo/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.cp39-win_amd64.pyd didn't match RECORD", "In /Users/fooboo/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll didn't match RECORD", "In /Users/fooboo/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll didn't match RECORD", "In /Users/fooboo/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe didn't match RECORD", "In /Users/fooboo/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe didn't match RECORD", "In /Users/fooboo/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll didn't match RECORD", "In /Users/fooboo/Library/Caches/pypoetry/artifacts/2e/09/48/001b624046a68d08cdbd434b4da9011c6d44fd1c83f9155679a8edad00/debugpy-1.6.6-py2.py3-none-any.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll didn't match RECORD"]

@int19h
Copy link
Contributor

int19h commented Apr 5, 2023

debugpy 1.6.7 is now up on PyPI and should fix this problem. Please let me know if there are any issues.

@int19h int19h closed this as completed Apr 5, 2023
@roy-pstr
Copy link

roy-pstr commented Apr 19, 2023

This problem was solved with Poetry version 1.4.2!

image

poetry debug info:

Poetry
Version: 1.4.2
Python:  3.9.5

Virtualenv
Python:         3.9.5
Implementation: CPython
Path:           ***
Executable:     ***
Valid:          True

System
Platform:   darwin
OS:         posix
Python:     3.9.5
Path:       /Library/Frameworks/Python.framework/Versions/3.9
Executable: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9

@mmabrouk
Copy link

mmabrouk commented May 5, 2023

I still get an error:

  Output:
  ERROR: debugpy-1.6.7-cp39-cp39-macosx_11_0_x86_64.whl is not a supported wheel on this platform.
  

I am using a macos 13.2.1 (22D68)

Installing with pip works by the way.

I tried installing both with poetry 1.4.0 and 1.4.2, also tried poetry config installer.modern-installation false with no avail.

@mmabrouk
Copy link

mmabrouk commented May 5, 2023

I have found a solution to my issue, along with a workaround that may be helpful to others who encounter a similar problem.

Here is the issue as I understand it: the wheel file for debugpy is named debugpy-1.6.7-cp39-cp39-macosx_11_0_x86_64.whl, which is not the correct platform for pip (in my case, I am using macOS 13.2.1). When I run pip install with the wheel file, I receive the same error as when using Poetry. This is because Poetry is also using pip under the hood to install the wheel file and encountering the same error.

To resolve the issue, follow these steps:

  1. Download the wheel file for debugpy from the original source.
  2. Rename the wheel file to make it compatible with all platforms by running this command:
mv debugpy-1.6.7-cp39-cp39-macosx_11_0_x86_64.whl debugpy-1.6.7-cp39-none-any.whl
  1. Remove debugpy from the poetry.lock file.
  2. Manually add the wheel file to Poetry with the following command:
poetry add debugpy-1.6.7-cp39-none-any.whl --platform linux/amd64
  1. Install as usual with the command:
poetry install -E all

I hope this helps!

@int19h
Copy link
Contributor

int19h commented May 5, 2023

There are several wheels for debugpy, one of which is the none-any wheel, which is the one that ought to be used for M1/M2 Macs. Can you clarify if you're using pip install directly on a downloaded wheel, or you're seeing this error just asking it for debugpy?

@mmabrouk
Copy link

For some reason poetry is using debugpy-1.6.7-cp39-cp39-macosx_11_0_x86_64.whl and not none-any. My solution is to download the debugpy-1.6.7-cp39-cp39-macosx_11_0_x86_64.whl and rename it to none-any then install it manually. I hope this helps

@guidorice
Copy link

guidorice commented Nov 27, 2023

poetry 1.7.1 on macos and it looks this is still occurring.

... depends on debugpy (*) which doesn't match any versions, version solving failed.

Has anyone considered that this issue should be re-opened?

edit: sorry, it appears this worked for me:

poetry add debugpy=1.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
None yet
Development

No branches or pull requests