semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Poetry Install crashes for python-preview branch.

Open Codie-Petersen opened this issue 2 years ago • 1 comments

Describe the bug The poetry install command fails at debugpy installation. Possibly due to hashing error on 'debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll'.

To Reproduce Steps to reproduce the behavior:

  1. Checkout python-preview branch: git checkout python-preview
  2. Change directory to python: cd python
  3. Install Poetry: pip install poetry
  4. Run Poetry installation: poetry install
  5. Should install most but stops and fails at debugpy.

Expected behavior I was walking through the README.md tutorial for python setup in the branch. Expected the install to go through nicely.

Log This is the log after a second install attempt.

Package operations: 7 installs, 0 updates, 0 removals

  • Installing debugpy (1.6.6)

  _WheelFileValidationError

  ["In C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache\\artifacts\\f3\\fe\\7e\\ae79971a5d18da24266b2396f07920898302fe5605d3467a4c20e44be7\\debugpy-1.6.6-cp310-cp310-win_amd64.whl, hash / size of debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.cp310-win_amd64.pyd didn't match RECORD", "In C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache\\artifacts\\f3\\fe\\7e\\ae79971a5d18da24266b2396f07920898302fe5605d3467a4c20e44be7\\debugpy-1.6.6-cp310-cp310-win_amd64.whl, hash / size of debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.cp310-win_amd64.pyd didn't match RECORD", "In C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache\\artifacts\\f3\\fe\\7e\\ae79971a5d18da24266b2396f07920898302fe5605d3467a4c20e44be7\\debugpy-1.6.6-cp310-cp310-win_amd64.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_amd64.dll didn't match RECORD", "In C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache\\artifacts\\f3\\fe\\7e\\ae79971a5d18da24266b2396f07920898302fe5605d3467a4c20e44be7\\debugpy-1.6.6-cp310-cp310-win_amd64.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_x86.dll didn't match RECORD", "In C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache\\artifacts\\f3\\fe\\7e\\ae79971a5d18da24266b2396f07920898302fe5605d3467a4c20e44be7\\debugpy-1.6.6-cp310-cp310-win_amd64.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_amd64.exe didn't match RECORD", "In C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache\\artifacts\\f3\\fe\\7e\\ae79971a5d18da24266b2396f07920898302fe5605d3467a4c20e44be7\\debugpy-1.6.6-cp310-cp310-win_amd64.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/inject_dll_x86.exe didn't match RECORD", "In C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache\\artifacts\\f3\\fe\\7e\\ae79971a5d18da24266b2396f07920898302fe5605d3467a4c20e44be7\\debugpy-1.6.6-cp310-cp310-win_amd64.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_amd64.dll didn't match RECORD", "In C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache\\artifacts\\f3\\fe\\7e\\ae79971a5d18da24266b2396f07920898302fe5605d3467a4c20e44be7\\debugpy-1.6.6-cp310-cp310-win_amd64.whl, hash / size of debugpy/_vendored/pydevd/pydevd_attach_to_process/run_code_on_dllmain_x86.dll didn't match RECORD"]

  at ~\AppData\Local\Programs\Python\Python310\lib\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│

Desktop (please complete the following information):

  • OS [dxdiag]: Windows 10 Pro 64-bit Build 19044
  • Python: Python 3.10.6
  • Pip: 23.0.1
  • VSCode:
    • 1.76.2
    • ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
    • x64

Codie-Petersen avatar Mar 19 '23 23:03 Codie-Petersen

@alexchaomander , can you take a look please?

timlaverty avatar Mar 20 '23 00:03 timlaverty

@Codie-Petersen Hmm I'm not able to reproduce this on my side. Can you clear your pypoetry cache and try again?

rm -rf ~/.cache/pypoetry/

alexchaomander avatar Mar 20 '23 19:03 alexchaomander

Same problem for python 3.11.2

richardk53 avatar Mar 20 '23 19:03 richardk53

@alexchaomander Just tried it, didn't work. Might work for other people though.

For other people who want to try on windows (@richardk53 maybe): poetry config --list

Should give you this:

cache-dir = "C:\\Users\\peter\\AppData\\Local\\pypoetry\\Cache"
experimental.new-installer = true
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.parallel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}\\virtualenvs"  # C:\Users\peter\AppData\Local\pypoetry\Cache\virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"

Then you can try manually deleting the pypoetry folder with the cache-dir.

Codie-Petersen avatar Mar 20 '23 21:03 Codie-Petersen

I can reproduce this now! (I run an ubuntu desktop and WSL normally, but setup on regular Windows to reproduce this.)

This issue seems to be the culprit: https://github.com/microsoft/debugpy/issues/1246

For now, it seems the workaround is:

poetry config installer.modern-installation false --local

After that, you should be able to complete:

poetry install

poetry shell

python

And, in the python terminal, do something like import semantic_kernel as sk.

jjhenkel avatar Mar 20 '23 21:03 jjhenkel

@jjhenkel Nice, that worked. Thanks.

@richardk53 Solution if you are on windows.

Codie-Petersen avatar Mar 20 '23 21:03 Codie-Petersen