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

Poetry 1.4.0: There is no item named <package>/WHEEL in the archive #7572

Closed
4 tasks done
elventear opened this issue Feb 28, 2023 · 20 comments · Fixed by #7671
Closed
4 tasks done

Poetry 1.4.0: There is no item named <package>/WHEEL in the archive #7572

elventear opened this issue Feb 28, 2023 · 20 comments · Fixed by #7671
Labels
kind/bug Something isn't working as expected status/external-issue Issue is caused by external project (platform, dep, etc)

Comments

@elventear
Copy link

elventear commented Feb 28, 2023

  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Hypercorn can't be installed with poetry 1.4.0, it used to be possible to install it:

poetry install                                                                                                                                                                                                          
Creating virtualenv test in /path/to/.venv
Updating dependencies
Resolving dependencies... (0.4s)

Writing lock file

Package operations: 8 installs, 0 updates, 0 removals

  • Installing h11 (0.14.0)
  • Installing hpack (4.0.0)
  • Installing hyperframe (6.0.1)
  • Installing h2 (4.1.0)
  • Installing priority (2.0.0)
  • Installing toml (0.10.2)
  • Installing wsproto (1.2.0)
  • Installing hypercorn (0.14.3): Failed

  Stack trace:

  10  ~/.local/pipx/venvs/poetry/lib/python3.11/site-packages/poetry/installation/executor.py:271 in _execute_operation
       269│
       270│             try:
     → 271│                 result = self._do_execute_operation(operation)
       272│             except EnvCommandError as e:
       273│                 if e.e.returncode == -2:

   9  ~/.local/pipx/venvs/poetry/lib/python3.11/site-packages/poetry/installation/executor.py:357 in _do_execute_operation
       355│             return 0
       356│
     → 357│         result: int = getattr(self, f"_execute_{method}")(operation)
       358│
       359│         if result != 0:

   8  ~/.local/pipx/venvs/poetry/lib/python3.11/site-packages/poetry/installation/executor.py:477 in _execute_install
       475│
       476│     def _execute_install(self, operation: Install | Update) -> int:
     → 477│         status_code = self._install(operation)
       478│
       479│         self._save_url_reference(operation)

   7  ~/.local/pipx/venvs/poetry/lib/python3.11/site-packages/poetry/installation/executor.py:535 in _install
       533│                 self._remove(operation.initial_package)
       534│
     → 535│             self._wheel_installer.install(archive)
       536│         finally:
       537│             if cleanup_archive:

   6  ~/.local/pipx/venvs/poetry/lib/python3.11/site-packages/poetry/installation/wheel_installer.py:101 in install
        99│     def install(self, wheel: Path) -> None:
       100│         with WheelFile.open(Path(wheel.as_posix())) as source:
     → 101│             install(
       102│                 source=source,
       103│                 destination=self._destination.for_source(source),

   5  ~/.local/pipx/venvs/poetry/lib/python3.11/site-packages/installer/_core.py:77 in install
        75│
        76│     """
     →  77│     root_scheme = _process_WHEEL_file(source)
        78│
        79│     # RECORD handling

   4  ~/.local/pipx/venvs/poetry/lib/python3.11/site-packages/installer/_core.py:21 in _process_WHEEL_file
        19│     Returns the scheme that the archive root should go in.
        20│     """
     →  21│     stream = source.read_dist_info("WHEEL")
        22│     metadata = parse_metadata_file(stream)
        23│

   3  ~/.local/pipx/venvs/poetry/lib/python3.11/site-packages/installer/sources.py:139 in read_dist_info
       137│         """Get contents, from ``filename`` in the dist-info directory."""
       138│         path = posixpath.join(self.dist_info_dir, filename)
     → 139│         return self._zipfile.read(path).decode("utf-8")
       140│
       141│     def get_contents(self) -> Iterator[WheelContentElement]:

   2  /opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py:1507 in read
       1505│     def read(self, name, pwd=None):
       1506│         """Return file bytes for name."""
     → 1507│         with self.open(name, "r", pwd) as fp:
       1508│             return fp.read()
       1509│

   1  /opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py:1544 in open
       1542│         else:
       1543│             # Get info object for name
     → 1544│             zinfo = self.getinfo(name)
       1545│
       1546│         if mode == 'w':

  KeyError

  "There is no item named 'Hypercorn-0.14.3.dist-info/WHEEL' in the archive"

  at /opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py:1473 in getinfo
      1469│     def getinfo(self, name):
      1470│         """Return the instance of ZipInfo given 'name'."""
      1471│         info = self.NameToInfo.get(name)
      1472│         if info is None:
    → 1473│             raise KeyError(
      1474│                 'There is no item named %r in the archive' % name)
      1475│
      1476│         return info

Wondering if there is a case sensitivity issue. Looking at the wheel, I do see there is a file in hypercorn-0.14.3.dist-info/WHEEL.

@elventear elventear added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 28, 2023
@cfculhane
Copy link

+1 to this, getting it when installing detectron2 from a wheel with

 "There is no item named 'detectron2-0.6+cu117.dist-info/WHEEL' in the archive"

Downgrading to 1.3.2 solved the problem.

@elventear elventear changed the title Poetry 1.4.0 can't install Hypercorn 0.14.3 Poetry 1.4.0: There is no item named '<package>/WHEEL' in the archive Feb 28, 2023
@elventear elventear changed the title Poetry 1.4.0: There is no item named '<package>/WHEEL' in the archive Poetry 1.4.0: There is no item named <package>/WHEEL in the archive Feb 28, 2023
@dimaqq
Copy link
Contributor

dimaqq commented Feb 28, 2023

Hit me too, looks like 1.4.0 is a corked release... 🙈
The rest of packages can be installed fine, so maybe someone can look specifically at hypercorn

@yanyongyu
Copy link

it seems that there is a dir named hypercorn-0.14.3.dist-info but not Hypercorn-0.14.3.dist-info in the wheel. The name is lowered.

@finswimmer
Copy link
Member

Hey everyone,

thanks a lot for reporting. This seems to be an issue within the installer package which is now used for installing packages. I'm able to reproduce this error with the code example given in the docs. @pradyunsg can you have a look into this?

For now one can disable the new installer with poetry config installer.modern-installation false. (https://python-poetry.org/docs/master/configuration/#installermodern-installation)

fin swimmer

@finswimmer finswimmer added the status/external-issue Issue is caused by external project (platform, dep, etc) label Feb 28, 2023
@dimbleby
Copy link
Contributor

dimbleby commented Feb 28, 2023

I see that the hypercorn wheel on pypi is called Hypercorn-0.14.3-py3-none-any.whl with a capital H. I expect that is what has confused installer.

I notice that hypercorn itself uses poetry, and I guess that unusual capitalisation comes from https://github.com/pgjones/hypercorn/blob/8ae17ca68204d9718389fb3649ca0ed6ba851906/pyproject.toml#L2.

recent versions of poetry normalize the wheel filename, so likely this can be resolved either by

  • installer being tolerant of unnormalized distribution file names (probably there are a lot of these out there)
    • and poetry picking up a new release of installer
  • or, hypercorn publishing a new release built from a recent poetry

@bentheiii
Copy link

Also getting it on version 0.81 of xgboost (Whether newer versions work I don't know)

This is a major issue that can break every CICD workflow in a project, if a patch will not be available in the next few hours, what are the odds that poetry 1.4.0 will be yanked until a fix is released?

@finswimmer
Copy link
Member

Hey @bentheiii,

as you've probably read in the comments by @dimbleby and me, this is not a Poetry issue per se. So I don't think we will yank 1.4.0 nor there will be a fix "in the next few hours".

You should always pin the Poetry version used in your CI Pipeline: https://python-poetry.org/docs/master/#ci-recommendations.

Also you can fallback to the old installer as described above.

fin swimmer

@pradyunsg
Copy link
Contributor

pradyunsg commented Feb 28, 2023

This is pypa/installer#134, and it's gonna have to wait until after my work day for a fix to be released.

@mstandley-tempus
Copy link

Wondering if there is a case sensitivity issue. Looking at the wheel, I do see there is a file in hypercorn-0.14.3.dist-info/WHEEL.

I think so too, we observed the problem in another package. EntilZha/PyFunctional#176

When I inspect the contents of wheel file, I see that the path to the file is pyfunctional-1.4.3.dist-info/WHEEL not PyFunctional-1.4.3.dist-info/WHEEL. Could the case difference in the directory name be causing this error?

@thehappydinoa
Copy link

thehappydinoa commented Mar 2, 2023

Experiencing the same issue in kazhala/InquirerPy#57. Downgrading to 1.3.2 resolved the issue for now.

@rafales
Copy link

rafales commented Mar 3, 2023

Same issue. Downgrading to 1.3.2 helped. For me it was flask-mailman package. It seems that it's due to case sensitivity: package name itself / wheel / zip file uses Flask-Mailman but wheel contains folder that is all lowercase.

@cquick01
Copy link

cquick01 commented Mar 3, 2023

Same issue with hypercorn on poetry 1.4.0. Disabling the new installer with poetry config installer.modern-installation false as suggested worked for me as a workaround.

@dimbleby
Copy link
Contributor

dimbleby commented Mar 3, 2023

hypercorn is literally where this issue started. If y'all could please refrain from "me too" it would save on noise.

plockaby added a commit to paullockaby/enphase-proxy that referenced this issue Mar 4, 2023
We can unpin poetry when either of these issues are closed:
- python-poetry/poetry#7572
- pgjones/hypercorn#102
@woidda
Copy link

woidda commented Mar 6, 2023

Same issue

#0 29.88   KeyError
#0 29.88 
#0 29.88   "There is no item named 'Hypercorn-0.14.3.dist-info/WHEEL' in the archive"
#0 29.88 
#0 29.88   at /usr/local/lib/python3.11/zipfile.py:1473 in getinfo
#0 29.92       1469│     def getinfo(self, name):
#0 29.92       1470│         """Return the instance of ZipInfo given 'name'."""
#0 29.92       1471│         info = self.NameToInfo.get(name)
#0 29.92       1472│         if info is None:
#0 29.92     → 1473│             raise KeyError(
#0 29.92       1474│                 'There is no item named %r in the archive' % name)
#0 29.92       1475│ 
#0 29.92       1476│         return info
#0 29.92       1477│

Pinning poetry to 1.3.2 helped.

@mehaase
Copy link

mehaase commented Mar 10, 2023

It's not just case sensitivity, Poetry 1.4.0 normalization is messing up punctuation.

• Installing sphinxcontrib-applehelp (1.0.3)

  KeyError

  "There is no item named 'sphinxcontrib.applehelp-1.0.3.dist-info/WHEEL' in the archive"

  at /opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/zipfile.py:1441 in getinfo
      1437│     def getinfo(self, name):
      1438│         """Return the instance of ZipInfo given 'name'."""
      1439│         info = self.NameToInfo.get(name)
      1440│         if info is None:
      1441│             raise KeyError(
      1442│                 'There is no item named %r in the archive' % name)
      1443│ 
      1444│         return info
      1445│

Poetry is looking for a dot in the name but the package has an underscore:

EXPECTED: sphinxcontrib.applehelp-1.0.3.dist-info/WHEEL
ACTUAL:   sphinxcontrib_applehelp-1.0.3.dist-info/WHEEL
                       ^

This is going to break a lot of CI builds.

@dimbleby
Copy link
Contributor

there's already a more recent release of sphinxcontrib-applehelp fixing their package name (and I suspect you overestimate the amount of CI builds that care about it!)

Can I again encourage y'all to think twice before adding yet another example here.

  • The issue is known, and well understood
  • There's a fix in the main branch of https://github.com/pypa/installer
  • if and when that is released, poetry will pick that fix up in due course
  • meanwhile you can sidestep it by disabling the modern installer as introduced at poetry 1.4.0: poetry config installer.modern-installation false

It's unlikely that further comments will either add new information, or change what happens next.

@mehaase
Copy link

mehaase commented Mar 10, 2023

All of the other comments here are about capitalization, so I was pointing out that it's also about punctuation. I thought maybe the developers would like to have a more complete picture of what the buggy behavior is.

I'm sorry that I took time out of my morning to google this issue, find this thread, reproduce it on 1.4.0, make sure it does not reproduce on 1.3.2, download an archive from pypi, identify the discrepancy that nobody else has noticed yet, put together a concise and informative post on the topic, and then edit it several times.

Believe me, it will not happen again. /unsubscribe

@johnthagen
Copy link
Contributor

This is pypa/installer#134, and it's gonna have to wait until after my work day for a fix to be released.

@pradyunsg Any update on getting a new installer released to PyPI? Anything the community can help with? ❤️

archlinux-github pushed a commit to archlinux/aurweb that referenced this issue Mar 15, 2023
The "install" module (v0.6.0) which is being used by poetry 1.4.0
has problems installing certain packages.

Disable the modern installer for now, until things are fixed.

python-poetry/poetry#7572
Signed-off-by: moson-mo <mo-son@mailbox.org>
vanducng added a commit to vdn-tools/dbt-athena2 that referenced this issue Mar 16, 2023
@pradyunsg
Copy link
Contributor

pradyunsg commented Mar 17, 2023

The installer release is out -- things should be better now?

inglor pushed a commit to archlinux/aurweb that referenced this issue May 1, 2023
The problems with the "modern installer" got fixed.
We don't need this workaround anymore.

python-poetry/poetry#7572
Signed-off-by: moson-mo <mo-son@mailbox.org>
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/external-issue Issue is caused by external project (platform, dep, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.