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 update never finishes resolve and Poetry show --outdated hangs #832

Closed
1 of 3 tasks
amal-khailtash opened this issue Jan 24, 2019 · 22 comments
Closed
1 of 3 tasks

Comments

@amal-khailtash
Copy link

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Oracle Linux Server 7.5

  • Poetry version: 0.12.11

  • Link of a Gist with the contents of your pyproject.toml file: Part of it included.

pyproject.toml

[tool.poetry]
name = "tool"
version = "2.0.16"
description = "Tool"
authors = [
    "Amal <???@...>"
]

readme = "README.rst"

include = [
]

classifiers = [
    "Development Status :: 1 - Planning",
    "Environment :: Console",
    "Intended Audience :: Developers",
    "Natural Language :: English",
    "License :: Other/Proprietary License",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.7",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: Implementation :: CPython",
    "Topic :: Software Development",
    "Topic :: Software Development :: Libraries",
]

[tool.poetry.dependencies]
python = "^3.7"

bit-vector = "0.42a0"
click = "^7.0"
click_completion = "^0.5.0"
click_help_colors = "^0.5.0"
coloredlogs = "^10.0"
prompt-toolkit = "^2.0"
Pygments = "^2.3"
PyXB = "^1.2"
sly = "^0.3.0"
sty = "1.0.0b8"
tabulate = "^0.8.2"
termcolor = "^1.1"

[tool.poetry.dev-dependencies]
# Documentation
sphinx = "^1.8"
sphinx-rtd-theme = "^0.4.2"
sphinx-click = "^1.4"

# Test
pytest = "^4.0"
pytest-cov = "^2.6"
pytest-flake8 = "^1.0"
pytest-pylint = "^0.14.0"

[tool.poetry.scripts]
tool = "tool.cli:main"

[[tool.poetry.source]]
name = "thw"
url = "https://artifactory/api/pypi/pypi-mirror/simple"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

Issue

When I try to see the list of outdated dependencies (poetry show --outdated), poetry hangs. And "poetry updated" gets stuck on "Resolving dependencies" and incrementing time (166.8s).

Running with --vvv:

$ poetry -vvv show --outdated
Using virtualenv: .../.venv

Pressing CTRL+C shows:

^C
[KeyboardInterrupt]

Exception trace:
 .venv/lib/python3.7/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 .venv/lib/python3.7/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 .venv/lib/python3.7/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 .venv/lib/python3.7/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 .venv/lib/python3.7/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 .venv/lib/python3.7/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 .venv/lib/python3.7/site-packages/poetry/console/commands/show.py in handle() at line 124
   latest = self.find_latest_package(locked)
 .venv/lib/python3.7/site-packages/poetry/console/commands/show.py in find_latest_package() at line 305
   return selector.find_best_candidate(name, ">={}".format(package.pretty_version))
 .venv/lib/python3.7/site-packages/poetry/version/version_selector.py in find_best_candidate() at line 29
   package_name, constraint, allow_prereleases=allow_prereleases
 .venv/lib/python3.7/site-packages/poetry/repositories/pool.py in find_packages() at line 65
   name, constraint, extras=extras, allow_prereleases=allow_prereleases
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in find_packages() at line 105
   info = self.get_package_info(name)
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in get_package_info() at line 238
   name, lambda: self._get_package_info(name)
 .venv/lib/python3.7/site-packages/cachy/repository.py in remember_forever() at line 174
   val = value(callback)
 .venv/lib/python3.7/site-packages/cachy/helpers.py in value() at line 6
   return val()
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in <lambda>() at line 238
   name, lambda: self._get_package_info(name)
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in _get_package_info() at line 242
   data = self._get("pypi/{}/json".format(name))
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in _get() at line 391
   json_response = self._session.get(self._url + endpoint)
 .venv/lib/python3.7/site-packages/requests/sessions.py in get() at line 546
   return self.request('GET', url, **kwargs)
 .venv/lib/python3.7/site-packages/requests/sessions.py in request() at line 533
   resp = self.send(prep, **send_kwargs)
 .venv/lib/python3.7/site-packages/requests/sessions.py in send() at line 646
   r = adapter.send(request, **kwargs)
 .venv/lib/python3.7/site-packages/cachecontrol/adapter.py in send() at line 53
   resp = super(CacheControlAdapter, self).send(request, **kw)
 .venv/lib/python3.7/site-packages/requests/adapters.py in send() at line 533
   return self.build_response(request, resp)
 .venv/lib/python3.7/site-packages/cachecontrol/adapter.py in build_response() at line 80
   request, response
 .venv/lib/python3.7/site-packages/cachecontrol/controller.py in update_cached_response() at line 365
   self.cache.set(cache_url, self.serializer.dumps(request, cached_response))
 .venv/lib/python3.7/site-packages/cachecontrol/caches/file_cache.py in set() at line 126
   with self.lock_class(name) as lock:
 .venv/lib/python3.7/site-packages/lockfile/__init__.py in __enter__() at line 197
   self.acquire()
 .venv/lib/python3.7/site-packages/lockfile/linklockfile.py in acquire() at line 50
   time.sleep(timeout is not None and timeout / 10 or 0.1)

Update with verbose shows:

$ poetry -vvv update
Using virtualenv: .venv
Updating dependencies
Resolving dependencies...
   1: fact: tool is 2.0.16
   1: derived: tool
   1: fact: tool depends on bit-vector (0.42a0)
   1: fact: tool depends on click (^7.0)
   1: fact: tool depends on click_completion (^0.5.0)
   1: fact: tool depends on click_help_colors (^0.5.0)
   1: fact: tool depends on coloredlogs (^10.0)
   1: fact: tool depends on prompt-toolkit (^2.0)
   1: fact: tool depends on Pygments (^2.3)
   1: fact: tool depends on PyXB (^1.2)
   1: fact: tool depends on sly (^0.3.0)
   1: fact: tool depends on sty (1.0.0b8)
   1: fact: tool depends on tabulate (^0.8.2)
   1: fact: tool depends on termcolor (^1.1)
   1: fact: tool depends on sphinx (^1.8)
   1: fact: tool depends on sphinx-rtd-theme (^0.4.2)
   1: fact: tool depends on sphinx-click (^1.4)
   1: fact: tool depends on pytest (^4.0)
   1: fact: tool depends on pytest-cov (^2.6)
   1: fact: tool depends on pytest-flake8 (^1.0)
   1: fact: tool depends on pytest-pylint (^0.14.0)
   1: selecting tool (2.0.16)
   1: derived: pytest-pylint (^0.14.0)
   1: derived: pytest-flake8 (^1.0)
   1: derived: pytest-cov (^2.6)
   1: derived: pytest (^4.0)
   1: derived: sphinx-click (^1.4)
   1: derived: sphinx-rtd-theme (^0.4.2)
   1: derived: sphinx (^1.8)
   1: derived: termcolor (^1.1)
   1: derived: tabulate (^0.8.2)
   1: derived: sty (1.0.0b8)
   1: derived: sly (^0.3.0)
   1: derived: PyXB (^1.2)
   1: derived: Pygments (^2.3)
   1: derived: prompt-toolkit (^2.0)
   1: derived: coloredlogs (^10.0)
   1: derived: click_help_colors (^0.5.0)
   1: derived: click_completion (^0.5.0)
   1: derived: click (^7.0)
   1: derived: bit-vector (0.42a0)
PyPI: 1 packages found for pytest-pylint >=0.14.0,<0.15.0
   1: fact: pytest-pylint (0.14.0) depends on pytest (>=2.7)
   1: fact: pytest-pylint (0.14.0) depends on pylint (>=1.4.5)
   1: fact: pytest-pylint (0.14.0) depends on six (*)
   1: selecting pytest-pylint (0.14.0)
   1: derived: six (*)
   1: derived: pylint (>=1.4.5)
PyPI: 4 packages found for pytest-flake8 >=1.0,<2.0
   1: fact: pytest-flake8 (1.0.3) depends on flake8 (>=3.5)
   1: fact: pytest-flake8 (1.0.3) depends on pytest (>=3.5)
   1: selecting pytest-flake8 (1.0.3)
   1: derived: flake8 (>=3.5)
PyPI: 2 packages found for pytest-cov >=2.6,<3.0
   1: fact: pytest-cov (2.6.1) depends on pytest (>=3.6)
   1: fact: pytest-cov (2.6.1) depends on coverage (>=4.4)
   1: selecting pytest-cov (2.6.1)
   1: derived: coverage (>=4.4)
PyPI: 5 packages found for pytest >=4.0,<5.0
   1: fact: pytest (4.1.1) depends on py (>=1.5.0)
   1: fact: pytest (4.1.1) depends on six (>=1.10.0)
   1: fact: pytest (4.1.1) depends on attrs (>=17.4.0)
   1: fact: pytest (4.1.1) depends on more-itertools (>=4.0.0)
   1: fact: pytest (4.1.1) depends on atomicwrites (>=1.0)
   1: fact: pytest (4.1.1) depends on pluggy (>=0.7)
   1: fact: pytest (4.1.1) depends on colorama (*)
   1: selecting pytest (4.1.1)
   1: derived: colorama (*)
   1: derived: pluggy (>=0.7)
   1: derived: atomicwrites (>=1.0)
   1: derived: more-itertools (>=4.0.0)
   1: derived: attrs (>=17.4.0)
   1: derived: six (>=1.10.0)
   1: derived: py (>=1.5.0)
PyPI: 2 packages found for sphinx-click >=1.4,<2.0
   1: fact: sphinx-click (1.4.1) depends on pbr (>=2.0)
   1: fact: sphinx-click (1.4.1) depends on sphinx (>=1.5,<2.0)
   1: selecting sphinx-click (1.4.1)
   1: derived: pbr (>=2.0)
PyPI: No release information found for sphinx-rtd-theme-0.1.0, skipping
PyPI: 1 packages found for sphinx-rtd-theme >=0.4.2,<0.5.0
   1: fact: sphinx-rtd-theme (0.4.2) depends on sphinx (*)
   1: selecting sphinx-rtd-theme (0.4.2)
PyPI: 4 packages found for sphinx >=1.8,<2.0
   1: fact: sphinx (1.8.3) depends on six (>=1.5)
   1: fact: sphinx (1.8.3) depends on Jinja2 (>=2.3)
   1: fact: sphinx (1.8.3) depends on Pygments (>=2.0)
   1: fact: sphinx (1.8.3) depends on docutils (>=0.11)
   1: fact: sphinx (1.8.3) depends on snowballstemmer (>=1.1)
   1: fact: sphinx (1.8.3) depends on babel (>=1.3,<2.0 || >2.0)
   1: fact: sphinx (1.8.3) depends on alabaster (>=0.7,<0.8)
   1: fact: sphinx (1.8.3) depends on imagesize (*)
   1: fact: sphinx (1.8.3) depends on requests (>=2.0.0)
   1: fact: sphinx (1.8.3) depends on packaging (*)
   1: fact: sphinx (1.8.3) depends on sphinxcontrib-websupport (*)
   1: fact: sphinx (1.8.3) depends on colorama (>=0.3.5)
   1: selecting sphinx (1.8.3)
   1: derived: colorama (>=0.3.5)
   1: derived: sphinxcontrib-websupport (*)
   1: derived: packaging (*)
   1: derived: requests (>=2.0.0)
   1: derived: imagesize (*)
   1: derived: alabaster (>=0.7,<0.8)
   1: derived: babel (>=1.3,<2.0 || >2.0)
   1: derived: snowballstemmer (>=1.1)
   1: derived: docutils (>=0.11)
   1: derived: Jinja2 (>=2.3)
PyPI: 1 packages found for termcolor >=1.1,<2.0
   1: selecting termcolor (1.1.0)
PyPI: 1 packages found for tabulate >=0.8.2,<0.9.0
   1: selecting tabulate (0.8.2)
PyPI: 1 packages found for sty 1.0.0b8
   1: selecting sty (1.0.0b8)
PyPI: 1 packages found for sly >=0.3.0,<0.4.0
   1: selecting sly (0.3)
PyPI: 6 packages found for pyxb >=1.2,<2.0
   1: selecting pyxb (1.2.6)
PyPI: 2 packages found for pygments >=2.3,<3.0
   1: selecting pygments (2.3.1)
PyPI: 7 packages found for prompt-toolkit >=2.0,<3.0
   1: fact: prompt-toolkit (2.0.7) depends on six (>=1.9.0)
   1: fact: prompt-toolkit (2.0.7) depends on wcwidth (*)
   1: selecting prompt-toolkit (2.0.7)
   1: derived: wcwidth (*)
PyPI: 1 packages found for coloredlogs >=10.0,<11.0
   1: fact: coloredlogs (10.0) depends on humanfriendly (>=4.7)
   1: fact: coloredlogs (10.0) depends on colorama (*)
   1: selecting coloredlogs (10.0)
   1: derived: humanfriendly (>=4.7)
PyPI: 1 packages found for click-help-colors >=0.5.0,<0.6.0
   1: fact: click-help-colors (0.5) depends on click (>=7.0)
   1: selecting click-help-colors (0.5)
PyPI: 1 packages found for click-completion >=0.5.0,<0.6.0
   1: fact: click-completion (0.5.0) depends on click (*)
   1: fact: click-completion (0.5.0) depends on jinja2 (*)
   1: fact: click-completion (0.5.0) depends on six (*)
   1: fact: click-completion (0.5.0) depends on shellingham (*)
   1: selecting click-completion (0.5.0)
   1: derived: shellingham (*)
PyPI: 1 packages found for click >=7.0,<8.0
   1: selecting click (7.0)
PyPI: 1 packages found for bit-vector 0.42a0
   1: fact: bit-vector (0.42a0) depends on numpy (*)
   1: selecting bit-vector (0.42a0)
   1: derived: numpy (*)
PyPI: 3 packages found for six >=1.10.0
   1: selecting six (1.12.0)
PyPI: No release information found for pylint-0.10.0, skipping
PyPI: No release information found for pylint-0.11.0, skipping
PyPI: No release information found for pylint-0.12.1, skipping
PyPI: No release information found for pylint-0.13.0, skipping
PyPI: No release information found for pylint-0.14.0, skipping
PyPI: No release information found for pylint-0.4.1, skipping
PyPI: No release information found for pylint-0.6.0, skipping
PyPI: No release information found for pylint-0.6.1, skipping
PyPI: No release information found for pylint-0.7.0, skipping
PyPI: No release information found for pylint-0.8.1, skipping
PyPI: 38 packages found for pylint >=1.4.5
   1: fact: pylint (2.2.2) depends on astroid (>=2.0.0)
   1: fact: pylint (2.2.2) depends on isort (>=4.2.5)
   1: fact: pylint (2.2.2) depends on mccabe (*)
   1: fact: pylint (2.2.2) depends on colorama (*)
   1: selecting pylint (2.2.2)
   1: derived: mccabe (*)
   1: derived: isort (>=4.2.5)
   1: derived: astroid (>=2.0.0)
PyPI: 2 packages found for flake8 >=3.5
   1: fact: flake8 (3.6.0) depends on pyflakes (>=2.0.0,<2.1.0)
   1: fact: flake8 (3.6.0) depends on pycodestyle (>=2.4.0,<2.5.0)
   1: fact: flake8 (3.6.0) depends on mccabe (>=0.6.0,<0.7.0)
   1: selecting flake8 (3.6.0)
   1: derived: mccabe (>=0.6.0,<0.7.0)
   1: derived: pycodestyle (>=2.4.0,<2.5.0)
   1: derived: pyflakes (>=2.0.0,<2.1.0)
PyPI: No release information found for coverage-2.5, skipping
PyPI: No release information found for coverage-2.6, skipping
PyPI: No release information found for coverage-2.75, skipping
PyPI: No release information found for coverage-2.76, skipping
PyPI: No release information found for coverage-2.77, skipping
PyPI: No release information found for coverage-2.78, skipping
PyPI: No release information found for coverage-2.8, skipping
PyPI: No release information found for coverage-2.80, skipping
PyPI: No release information found for coverage-2.85, skipping
PyPI: 6 packages found for coverage >=4.4
   1: selecting coverage (4.5.2)
PyPI: 7 packages found for colorama >=0.3.5
   1: selecting colorama (0.4.1)
PyPI: 3 packages found for pluggy >=0.7
   1: selecting pluggy (0.8.1)
PyPI: 5 packages found for atomicwrites >=1.0
   1: selecting atomicwrites (1.2.1)
PyPI: 6 packages found for more-itertools >=4.0.0
   1: fact: more-itertools (5.0.0) depends on six (>=1.0.0,<2.0.0)
   1: selecting more-itertools (5.0.0)
PyPI: 3 packages found for attrs >=17.4.0
   1: selecting attrs (18.2.0)
PyPI: No release information found for py-0.8.0-alpha2, skipping
PyPI: No release information found for py-0.9.0, skipping
PyPI: No release information found for py-1.4.32.dev1, skipping
PyPI: 6 packages found for py >=1.5.0
   1: selecting py (1.7.0)
PyPI: 18 packages found for pbr >=2.0
   1: selecting pbr (5.1.1)
PyPI: 3 packages found for sphinxcontrib-websupport *
   1: selecting sphinxcontrib-websupport (1.1.0)
PyPI: 23 packages found for packaging *
   1: fact: packaging (19.0) depends on pyparsing (>=2.0.2)
   1: fact: packaging (19.0) depends on six (*)
   1: selecting packaging (19.0)
   1: derived: pyparsing (>=2.0.2)
PyPI: No release information found for requests-0.0.1, skipping
PyPI: No release information found for requests-0.12.01, skipping
PyPI: No release information found for requests-2.15.0, skipping
PyPI: 57 packages found for requests >=2.0.0
   1: fact: requests (2.21.0) depends on chardet (>=3.0.2,<3.1.0)
   1: fact: requests (2.21.0) depends on idna (>=2.5,<2.9)
   1: fact: requests (2.21.0) depends on urllib3 (>=1.21.1,<1.25)
   1: fact: requests (2.21.0) depends on certifi (>=2017.4.17)
   1: selecting requests (2.21.0)
   1: derived: certifi (>=2017.4.17)
   1: derived: urllib3 (>=1.21.1,<1.25)
   1: derived: idna (>=2.5,<2.9)
   1: derived: chardet (>=3.0.2,<3.1.0)
PyPI: 6 packages found for imagesize *
   1: selecting imagesize (1.1.0)
PyPI: No release information found for alabaster-0.0.1, skipping
PyPI: 12 packages found for alabaster >=0.7,<0.8
   1: selecting alabaster (0.7.12)
PyPI: No release information found for babel-0.8, skipping
PyPI: No release information found for babel-0.8.1, skipping
PyPI: No release information found for babel-0.9, skipping
PyPI: No release information found for babel-0.9.1, skipping
PyPI: No release information found for babel-0.9.2, skipping
PyPI: No release information found for babel-0.9.3, skipping
PyPI: No release information found for babel-0.9.4, skipping
PyPI: No release information found for babel-0.9.5, skipping
PyPI: 14 packages found for babel >=1.3,<2.0 || >2.0
   1: fact: babel (2.6.0) depends on pytz (>=0a)
   1: selecting babel (2.6.0)
   1: derived: pytz (>=0a)
PyPI: 3 packages found for snowballstemmer >=1.1
   1: selecting snowballstemmer (1.2.1)
PyPI: 4 packages found for docutils >=0.11
   1: selecting docutils (0.14)
PyPI: 25 packages found for jinja2 >=2.3
   1: fact: jinja2 (2.10) depends on MarkupSafe (>=0.23)
   1: selecting jinja2 (2.10)
   1: derived: MarkupSafe (>=0.23)
PyPI: 9 packages found for wcwidth *
   1: selecting wcwidth (0.1.7)
PyPI: 14 packages found for humanfriendly >=4.7
   1: fact: humanfriendly (4.17) depends on pyreadline (*)
   1: selecting humanfriendly (4.17)
   1: derived: pyreadline (*)
PyPI: 11 packages found for shellingham *
   1: selecting shellingham (1.2.8)
@amal-khailtash
Copy link
Author

After I press CTRL+C, I noticed this message:

^C   1: Version solving took 75.837 seconds.
   1: Tried 1 solutions.


[KeyboardInterrupt]

Exception trace:
 .venv/lib/python3.7/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 .venv/lib/python3.7/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 .venv/lib/python3.7/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 .venv/lib/python3.7/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 .venv/lib/python3.7/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 .venv/lib/python3.7/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 .venv/lib/python3.7/site-packages/poetry/console/commands/update.py in handle() at line 41
   return installer.run()
 .venv/lib/python3.7/site-packages/poetry/installation/installer.py in run() at line 76
   self._do_install(local_repo)
 .venv/lib/python3.7/site-packages/poetry/installation/installer.py in _do_install() at line 158
   ops = solver.solve(use_latest=self._whitelist)
 .venv/lib/python3.7/site-packages/poetry/puzzle/solver.py in solve() at line 38
   packages, depths = self._solve(use_latest=use_latest)
 .venv/lib/python3.7/site-packages/poetry/puzzle/solver.py in _solve() at line 171
   self._package, self._provider, locked=locked, use_latest=use_latest
 .venv/lib/python3.7/site-packages/poetry/mixology/__init__.py in resolve_version() at line 7
   return solver.solve()
 .venv/lib/python3.7/site-packages/poetry/mixology/version_solver.py in solve() at line 79
   next = self._choose_package_version()
 .venv/lib/python3.7/site-packages/poetry/mixology/version_solver.py in _choose_package_version() at line 354
   packages = self._provider.search_for(dependency)
 .venv/lib/python3.7/site-packages/poetry/puzzle/provider.py in search_for() at line 144
   allow_prereleases=dependency.allows_prereleases(),
 .venv/lib/python3.7/site-packages/poetry/repositories/pool.py in find_packages() at line 65
   name, constraint, extras=extras, allow_prereleases=allow_prereleases
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in find_packages() at line 105
   info = self.get_package_info(name)
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in get_package_info() at line 238
   name, lambda: self._get_package_info(name)
 .venv/lib/python3.7/site-packages/cachy/repository.py in remember_forever() at line 174
   val = value(callback)
 .venv/lib/python3.7/site-packages/cachy/helpers.py in value() at line 6
   return val()
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in <lambda>() at line 238
   name, lambda: self._get_package_info(name)
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in _get_package_info() at line 242
   data = self._get("pypi/{}/json".format(name))
 .venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in _get() at line 391
   json_response = self._session.get(self._url + endpoint)
 .venv/lib/python3.7/site-packages/requests/sessions.py in get() at line 546
   return self.request('GET', url, **kwargs)
 .venv/lib/python3.7/site-packages/requests/sessions.py in request() at line 533
   resp = self.send(prep, **send_kwargs)
 .venv/lib/python3.7/site-packages/requests/sessions.py in send() at line 646
   r = adapter.send(request, **kwargs)
 .venv/lib/python3.7/site-packages/cachecontrol/adapter.py in send() at line 53
   resp = super(CacheControlAdapter, self).send(request, **kw)
 .venv/lib/python3.7/site-packages/requests/adapters.py in send() at line 533
   return self.build_response(request, resp)
 .venv/lib/python3.7/site-packages/cachecontrol/adapter.py in build_response() at line 80
   request, response
 .venv/lib/python3.7/site-packages/cachecontrol/controller.py in update_cached_response() at line 365
   self.cache.set(cache_url, self.serializer.dumps(request, cached_response))
 .venv/lib/python3.7/site-packages/cachecontrol/caches/file_cache.py in set() at line 126
   with self.lock_class(name) as lock:
 .venv/lib/python3.7/site-packages/lockfile/__init__.py in __enter__() at line 197
   self.acquire()
 .venv/lib/python3.7/site-packages/lockfile/linklockfile.py in acquire() at line 50
   time.sleep(timeout is not None and timeout / 10 or 0.1)

update [--no-dev] [--dry-run] [--lock] [--] [<packages>]...

@amal-khailtash
Copy link
Author

For some reason, I found out that 'bit-vector = "0.42a0"' is causing this hang. Any of the following is the cause of the hang. I found this when I reported #824.

bit-vector = {version = "^0.42.0a0",allows-prereleases = true}
bit-vector = "0.42a0"

@floer32
Copy link

floer32 commented Apr 8, 2019

I think it may have something to do with Poetry's use of cachecontrol (notice the mentions of cachecontrol and lockfile towards end of logs).

If you dig through Poetry's source you'll see there is a class PyPiRepository, with an __init__ parameter disable_cache=False by default. It seems like there is not currently a way to disable it through Poetry, and there doesn't appear to be (relevant) global config overrides for cachecontrol or lockfile ...

What you can do in the meantime is to delete the Poetry cache dir and try running again. At first I thought I was still having the issue, but after a bit it moved on. So it really was a filelock deadlock at first for me, and for some reason always getting back into the state upon trying again... but 🤷‍♂️ I guess it is something intermittent.


How to find your cache - well, check the Poetry configuration docs to see about the OS-specific defaults. And you can delete it by hand that way.

There is also poetry cache:clear (version >1 it becomes poetry cache clear syntax). Its CLI docs are not very clear yet but I believe the usage is poetry cache clear $POETRY_VERSION --all

@bersace
Copy link

bersace commented Jun 4, 2019

@hangtwenty thanks for your point. I often hit outdated cache when i switch from one project to another. Uploading a new release of a libs in pypi doesn't invalidate poetry pypi cache.

@stale
Copy link

stale bot commented Nov 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 13, 2019
@nierob
Copy link

nierob commented Nov 20, 2019

I hit the same and I can confirm that running:
poetry cache:clear --all .
solves the problem

@stale stale bot removed the stale label Nov 20, 2019
@kivo360
Copy link

kivo360 commented Mar 18, 2020

Has anybody solved this? My installation is stuck and cache clear states I don't have any cache.

@cgungor
Copy link

cgungor commented Apr 3, 2020

Has anybody solved this? My installation is stuck and cache clear states I don't have any cache.

Can you share your poetry update -vvv log?

@joshorr
Copy link

joshorr commented Apr 14, 2020

I've had Poetry take over 800 seconds before giving up [it was bascially never finishing]. I tried poetry 1.0.0, 1.0.5, 1.1.0a1 and had the same results. I also cleared the cache on each poetry version I tried, with the same problem still happening.

Here is the log:

Poetry never finishing update.txt

I've attached a poetry update -vvv log @cgungor that showcases the issue. Reading the log, it looks like it keeps trying older and older versions of botocore due to docutils = "<0.16" requirement in botocore. Earlier in the process it decided to use docutils 0.16 due to sphinx (2.4.4) depends on docutils (>=0.12). I don't know why it did not figure out that docutils(>=0.10,<0.16) is fine with docutils (=0.15.2).

So I tried adding this to my .toml file: docutils = "<0.16". I reran the update and it finished in a about 4.5 seconds. Here is the output of that run:

Pinned Dep, poetry finishing update.txt

So for now I'll have to keep docutils pinned <0.16 my self, but it would have been really nice for poetry to figure it out on it's own!

@joshorr
Copy link

joshorr commented Apr 14, 2020

Thinking about this more, I suppose it's normal for it to go back and try older versions. In this case, botocore has a lot of versions to go though. So it may be using a depth-first search? Perhaps it should be a breadth-first search? Perhaps it could try each older version of each dependency it needs to figure out a solution for before trying two-versions back?

@joshorr
Copy link

joshorr commented Apr 14, 2020

I also tried doing botocore = ">=1.15.39" in my .toml file instead, it only took an extra second to find a solution vs the docutils = "<0.16". I like this way better since I can leave it be long-term without having a problem [at least until botocore starts having a lot of versions after 1.15.39 and Poetry slows down too much again, which I can then update this to a later version].

I think this makes it do a depth-limited search on botocore, so it can stop searching for solutions that never work and try something else that will work faster.

@Halkcyon
Copy link

I ran into this issue trying to run an update today. Clearing the cache appears to have resolved it, but resolution of packages across multiple indeces is extremely slow. When scanning for a package, if found in the default index, it proceeds to scan the secondary indeces anyways (where I have three in all so each package install is taking around TEN seconds).

@m-vdb
Copy link

m-vdb commented Dec 10, 2020

I ran into a similar issue today with poetry version 1.1.4. I was able to "solve" it by doing:

  • poetry cache clear --all .
  • rm poetry.lock
  • poetry install -vvv (for some reason, I ran it without the -vvv flag before and it kept hanging, at least with -vvv I see what's happening)
    🤷🏻

@Queuecumber
Copy link

I just had this today and it looks like mine was stuck looping on the following:

   1: fact: sphinxcontrib-katex (0.6.1) depends on sphinx (>=1.6)
   1: selecting sphinxcontrib-katex (0.6.1)

I had literally hundreds of the above lines printing out before I finally killed it, not sure why that is causing it to get stuck

@Queuecumber
Copy link

I can confirm that this works on poetry 1.0.10 so it is a regression (ref: #3802)

@Steffo99

This comment has been minimized.

@Steffo99

This comment has been minimized.

@issam-seghir
Copy link

@m-vdb
I confirm that this works on Poetry version 1.1.13

@mkniewallner
Copy link
Member

Closing this issue, because it's on a quite old version of Poetry, and poetry -vvv show --outdated works correctly on recent version.

For the "slowness" of the resolver, there's already a bunch of issues opened, the main one being #2094.

@jankatins
Copy link

Just FYI: I had a similar issue like the one above, with py-spy showing the following things:

 poetry add -G dev rich --verbose
Using virtualenv: /Users/jankatins/Library/Caches/pypoetry/virtualenvs/data-modelling-tools-poc-VMcWXSqY-py3.10
Using version ^12.6.0 for rich

Updating dependencies
Resolving dependencies... (0.9s)

Finding the necessary packages for the current system

Package operations: 0 installs, 1 update, 0 removals, 114 skipped

  • Updating linkml-runtime (1.3.3 -> 1.3.5): Pending...
^C^C
  %Own   %Total  OwnTime  TotalTime  Function (filename)
  1.00%   1.00%    2.57s     2.57s   acquire (lockfile/linklockfile.py)
  0.00%   1.00%   0.000s     2.57s   _get (repositories/pypi_repository.py)
  0.00%   1.00%   0.000s     2.57s   update_cached_response (cachecontrol/controller.py)
  0.00%   1.00%   0.000s     2.57s   _install (installation/executor.py)
  0.00%   1.00%   0.000s     2.57s   choose_for (installation/chooser.py)
  0.00%   1.00%   0.000s     2.57s   _do_execute_operation (installation/executor.py)
  0.00%   1.00%   0.000s     2.57s   _update (installation/executor.py)
  0.00%   1.00%   0.000s     2.57s   _execute_operation (installation/executor.py)
  0.00%   1.00%   0.000s     2.57s   __enter__ (lockfile/__init__.py)
  0.00%   1.00%   0.000s     2.57s   request (utils/authenticator.py)
  0.00%   1.00%   0.000s     2.57s   _write (cachecontrol/caches/file_cache.py)
  0.00%   1.00%   0.000s     2.57s   send (cachecontrol/adapter.py)
  0.00%   1.00%   0.000s     2.57s   send (requests/sessions.py)
  0.00%   1.00%   0.000s     2.57s   build_response (cachecontrol/adapter.py)
  0.00%   1.00%   0.000s     2.57s   run (concurrent/futures/thread.py)
  0.00%   1.00%   0.000s     2.57s   find_links_for_package (repositories/pypi_repository.py)
  0.00%   1.00%   0.000s     2.57s   _cache_set (cachecontrol/controller.py)
  0.00%   1.00%   0.000s     2.57s   set (cachecontrol/caches/file_cache.py)
  0.00%   1.00%   0.000s     2.57s   run (threading.py)
  0.00%   1.00%   0.000s     2.57s   _worker (concurrent/futures/thread.py)
  0.00%   1.00%   0.000s     2.57s   _bootstrap_inner (threading.py)
  0.00%   1.00%   0.000s     2.57s   send (requests/adapters.py)
  0.00%   1.00%   0.000s     2.57s   _get_links (installation/chooser.py)
  0.00%   1.00%   0.000s     2.57s   _download (installation/executor.py)
  0.00%   1.00%   0.000s     2.57s   _bootstrap (threading.py)
  0.00%   1.00%   0.000s     2.57s   _execute_update (installation/executor.py)
  0.00%   1.00%   0.000s     2.57s   get (utils/authenticator.py)

Running poetry cache clear --all . after removing the lock file solved it for me (removing the lock file itself didn't change a thing, but no idea if the cache clearing alone would have solved it.).

@AaronMoe
Copy link

I'm having a similar issue, I tried the cache clear and then run poetry update -vvv log - but I can't find a log file. Also, if there's new information on the issue of poetry getting stuck I'd be happy to hear about it. If there's people active here I think I could also show the pyproject.toml

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
None yet
Projects
None yet
Development

No branches or pull requests