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

Error while installing package (potentially due to a hyphen in name) #8036

Closed
radandreicristian opened this issue May 29, 2023 · 2 comments
Closed
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@radandreicristian
Copy link

radandreicristian commented May 29, 2023

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

Issue

I've just updated Poetry to the latest version. It seems that is has trouble installing hydra-core. I assumed it might have to do with its hyphen in the name, as other packages seem to work as expected. This happens if I'm trying to lock from this toml file, but adding the dependency with poetry add/install has a similar outcome.

Stacktrace:

Using virtualenv: /home/andrei-cristian/.cache/pypoetry/virtualenvs/kamidoo-web-nlp-services-sensitivecategori-d7T8gIC6-py3.10
Resolving dependencies...
   1: fact: generic is 0.1.0
   1: derived: generic
   1: fact: generic depends on hydra-core (^1.3.2)
   1: selecting generic (0.1.0)
   1: derived: hydra-core (>=1.3.2,<2.0.0)
[keyring.backend] Loading KWallet
[keyring.backend] Loading SecretService
[keyring.backend] Loading Windows
[keyring.backend] Loading chainer
[keyring.backend] Loading libsecret
[keyring.backend] Loading macOS
Creating new session for pypi.org
[urllib3.connectionpool] Starting new HTTPS connection (1): pypi.org:443
[urllib3.connectionpool] https://pypi.org:443 "GET /simple/hydra-core/ HTTP/1.1" 304 0
[filelock] Attempting to acquire lock 140167595168480 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/f/4/2/d/7/f42d73d14a90d13ee18456ff2b44fd694818794a2e3ae495abc32359.lock
[filelock] Lock 140167595168480 acquired on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/f/4/2/d/7/f42d73d14a90d13ee18456ff2b44fd694818794a2e3ae495abc32359.lock
[filelock] Attempting to release lock 140167595168480 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/f/4/2/d/7/f42d73d14a90d13ee18456ff2b44fd694818794a2e3ae495abc32359.lock
[filelock] Lock 140167595168480 released on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/f/4/2/d/7/f42d73d14a90d13ee18456ff2b44fd694818794a2e3ae495abc32359.lock
Source (PyPI): 1 packages found for hydra-core >=1.3.2,<2.0.0
   1: fact: hydra-core (1.3.2) depends on omegaconf (>=2.2,<2.4)
   1: fact: hydra-core (1.3.2) depends on antlr4-python3-runtime (==4.9.*)
   1: fact: hydra-core (1.3.2) depends on packaging (*)
   1: selecting hydra-core (1.3.2)
   1: derived: packaging
   1: derived: antlr4-python3-runtime (==4.9.*)
   1: derived: omegaconf (>=2.2,<2.4)
[urllib3.connectionpool] https://pypi.org:443 "GET /simple/packaging/ HTTP/1.1" 304 0
[filelock] Attempting to acquire lock 140167593460304 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/4/4/e/5/b/44e5b11a6caa92636d8ccfe658d420ba4ed8f67f7f4e835b214255aa.lock
[filelock] Lock 140167593460304 acquired on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/4/4/e/5/b/44e5b11a6caa92636d8ccfe658d420ba4ed8f67f7f4e835b214255aa.lock
[filelock] Attempting to release lock 140167593460304 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/4/4/e/5/b/44e5b11a6caa92636d8ccfe658d420ba4ed8f67f7f4e835b214255aa.lock
[filelock] Lock 140167593460304 released on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/4/4/e/5/b/44e5b11a6caa92636d8ccfe658d420ba4ed8f67f7f4e835b214255aa.lock
Source (PyPI): 41 packages found for packaging *
[urllib3.connectionpool] https://pypi.org:443 "GET /simple/antlr4-python3-runtime/ HTTP/1.1" 304 0
[filelock] Attempting to acquire lock 140167593175984 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/a/5/7/5/c/a575c12e8267d7f86d6cd3abb805f97876e63148428e5711e8668b4b.lock
[filelock] Lock 140167593175984 acquired on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/a/5/7/5/c/a575c12e8267d7f86d6cd3abb805f97876e63148428e5711e8668b4b.lock
[filelock] Attempting to release lock 140167593175984 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/a/5/7/5/c/a575c12e8267d7f86d6cd3abb805f97876e63148428e5711e8668b4b.lock
[filelock] Lock 140167593175984 released on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/a/5/7/5/c/a575c12e8267d7f86d6cd3abb805f97876e63148428e5711e8668b4b.lock
Source (PyPI): 4 packages found for antlr4-python3-runtime ==4.9.*
[urllib3.connectionpool] https://pypi.org:443 "GET /simple/omegaconf/ HTTP/1.1" 304 0
[filelock] Attempting to acquire lock 140167593247024 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/7/7/a/8/3/77a837dcab21cf92fce7aff99d6162ad74b31aa0ed9ea0eaf02f459f.lock
[filelock] Lock 140167593247024 acquired on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/7/7/a/8/3/77a837dcab21cf92fce7aff99d6162ad74b31aa0ed9ea0eaf02f459f.lock
[filelock] Attempting to release lock 140167593247024 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/7/7/a/8/3/77a837dcab21cf92fce7aff99d6162ad74b31aa0ed9ea0eaf02f459f.lock
[filelock] Lock 140167593247024 released on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/7/7/a/8/3/77a837dcab21cf92fce7aff99d6162ad74b31aa0ed9ea0eaf02f459f.lock
Source (PyPI): 4 packages found for omegaconf >=2.2,<2.4
Source (PyPI): The cache for antlr4-python3-runtime 4.9.3 is outdated. Refreshing.
Source (PyPI): Getting info for antlr4-python3-runtime (4.9.3) from PyPI
[urllib3.connectionpool] https://pypi.org:443 "GET /pypi/antlr4-python3-runtime/4.9.3/json HTTP/1.1" 304 0
[filelock] Attempting to acquire lock 140167592739264 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/a/e/1/1/1/ae1119b8d536d111aba162a3681326a9978e8a96e1b80c0d3e9dab87.lock
[filelock] Lock 140167592739264 acquired on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/a/e/1/1/1/ae1119b8d536d111aba162a3681326a9978e8a96e1b80c0d3e9dab87.lock
[filelock] Attempting to release lock 140167592739264 on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/a/e/1/1/1/ae1119b8d536d111aba162a3681326a9978e8a96e1b80c0d3e9dab87.lock
[filelock] Lock 140167592739264 released on /home/andrei-cristian/.cache/pypoetry/cache/repositories/PyPI/_http/a/e/1/1/1/ae1119b8d536d111aba162a3681326a9978e8a96e1b80c0d3e9dab87.lock
Source (PyPI): No dependencies found, downloading archives
   1: Version solving took 0.528 seconds.
   1: Tried 1 solutions.

  Stack trace:

  24  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:327 in run
       325│ 
       326│             try:
     → 327│                 exit_code = self._run(io)
       328│             except BrokenPipeError:
       329│                 # If we are piped to another process, it may close early and send a

  23  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/console/application.py:190 in _run
       188│         self._load_plugins(io)
       189│ 
     → 190│         exit_code: int = super()._run(io)
       191│         return exit_code
       192│ 

  22  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:431 in _run
       429│             io.input.interactive(interactive)
       430│ 
     → 431│         exit_code = self._run_command(command, io)
       432│         self._running_command = None
       433│ 

  21  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:473 in _run_command
       471│ 
       472│         if error is not None:
     → 473│             raise error
       474│ 
       475│         return terminate_event.exit_code

  20  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/application.py:457 in _run_command
       455│ 
       456│             if command_event.command_should_run():
     → 457│                 exit_code = command.run(io)
       458│             else:
       459│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED

  19  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/commands/base_command.py:119 in run
       117│         io.input.validate()
       118│ 
     → 119│         status_code = self.execute(io)
       120│ 
       121│         if status_code is None:

  18  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/cleo/commands/command.py:62 in execute
        60│ 
        61│         try:
     →  62│             return self.handle()
        63│         except KeyboardInterrupt:
        64│             return 1

  17  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/console/commands/lock.py:52 in handle
        50│         self.installer.lock(update=not self.option("no-update"))
        51│ 
     →  52│         return self.installer.run()
        53│ 

  16  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/installer.py:95 in run
        93│         # Check if refresh
        94│         if not self._update and self._lock and self._locker.is_locked():
     →  95│             return self._do_refresh()
        96│ 
        97│         # Force update if there is no lock file present

  15  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/installer.py:201 in _do_refresh
       199│             source_root=self._env.path.joinpath("src")
       200│         ):
     → 201│             ops = solver.solve(use_latest=use_latest).calculate_operations()
       202│ 
       203│         lockfile_repo = LockfileRepository()

  14  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:72 in solve
        70│         with self._progress(), self._provider.use_latest_for(use_latest or []):
        71│             start = time.time()
     →  72│             packages, depths = self._solve()
        73│             end = time.time()
        74│ 

  13  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:155 in _solve
       153│ 
       154│         try:
     → 155│             result = resolve_version(self._package, self._provider)
       156│ 
       157│             packages = result.packages

  12  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/__init__.py:18 in resolve_version
        16│     solver = VersionSolver(root, provider)
        17│ 
     →  18│     return solver.solve()
        19│ 

  11  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:112 in solve
       110│             while next is not None:
       111│                 self._propagate(next)
     → 112│                 next = self._choose_package_version()
       113│ 
       114│             return self._result()

  10  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/mixology/version_solver.py:430 in _choose_package_version
       428│             package = locked
       429│ 
     → 430│         package = self._provider.complete_package(package)
       431│ 
       432│         conflict = False

   9  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/provider.py:482 in complete_package
       480│                 dependency_package = DependencyPackage(
       481│                     dependency,
     → 482│                     self._pool.package(
       483│                         package.pretty_name,
       484│                         package.version,

   8  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/repositories/repository_pool.py:178 in package
       176│         for repo in self.repositories:
       177│             try:
     → 178│                 return repo.package(name, version, extras=extras)
       179│             except PackageNotFound:
       180│                 continue

   7  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/repositories/cached_repository.py:76 in package
        74│         extras: list[str] | None = None,
        75│     ) -> Package:
     →  76│         return self.get_release_info(canonicalize_name(name), version).to_package(
        77│             name=name, extras=extras
        78│         )

   6  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/repositories/cached_repository.py:64 in get_release_info
        62│                 level="debug",
        63│             )
     →  64│             cached = self._get_release_info(name, version)
        65│ 
        66│             self._release_cache.put(f"{name}:{version}", cached)

   5  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/repositories/pypi_repository.py:205 in _get_release_info
       203│                 return data.asdict()
       204│ 
     → 205│             info = self._get_info_from_urls(urls)
       206│ 
       207│             data.requires_dist = info.requires_dist

   4  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/repositories/http_repository.py:205 in _get_info_from_urls
       203│                 return self._get_info_from_wheel(first_wheel)
       204│ 
     → 205│         return self._get_info_from_sdist(urls["sdist"][0])
       206│ 
       207│     def _links_to_data(self, links: list[Link], data: PackageInfo) -> dict[str, Any]:

   3  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/repositories/http_repository.py:99 in _get_info_from_sdist
        97│ 
        98│         with self._cached_or_downloaded_file(Link(url)) as filepath:
     →  99│             return PackageInfo.from_sdist(filepath)
       100│ 
       101│     def _get_info_from_urls(self, urls: dict[str, list[str]]) -> PackageInfo:

   2  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/inspection/info.py:519 in from_sdist
       517│         """
       518│         if path.is_file():
     → 519│             return cls._from_sdist_file(path=path)
       520│ 
       521│         # if we get here then it is neither an sdist instance nor a file

   1  ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/inspection/info.py:313 in _from_sdist_file
       311│         with temporary_directory() as tmp_str:
       312│             tmp = Path(tmp_str)
     → 313│             with context(path.as_posix()) as archive:
       314│                 archive.extractall(tmp.as_posix())
       315│ 

  ReadError

  file could not be opened successfully

  at ~/miniconda3/lib/python3.9/tarfile.py:1625 in open
      1621│                 except (ReadError, CompressionError):
      1622│                     if fileobj is not None:
      1623│                         fileobj.seek(saved_pos)
      1624│                     continue
    → 1625│             raise ReadError("file could not be opened successfully")
      1626│ 
      1627│         elif ":" in mode:
      1628│             filemode, comptype = mode.split(":", 1)
      1629│             filemode = filemode or "r"
@radandreicristian radandreicristian added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 29, 2023
@dimbleby
Copy link
Contributor

clear your poetry cache, #7968, please close

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/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants