poetry: Poetry doesn't find any version for the package Babel

  • 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).

  • Ubuntu 18.04:

  • 0.12.17:

Issue

I added the package Babel to pyproject.toml, but poetry install fails to install. I tried writing Babel in small letters, but poetry doesn’t find a version of it. If I run poetry search babel it is listed in the search results though. According to Babel’s setup.py it should be compatible with my python version 3.6, see: https://github.com/python-babel/babel/blob/master/setup.py#L58

Error message

$ poetry install -vvv
Using virtualenv: /home/user/.cache/pypoetry/virtualenvs/my_app-py3.6
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.
                                                                                                
[SolverProblemError]                                                             
Because my_app depends on babel (*) which doesn't match any versions, version solving failed.  
                                                                                                
Exception trace:
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/poetry/console/commands/install.py in handle() at line 55
   return_code = installer.run()
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/poetry/installation/installer.py in run() at line 73
   self._do_install(local_repo)
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/poetry/installation/installer.py in _do_install() at line 229
   ops = solver.solve(use_latest=whitelist)
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/poetry/puzzle/solver.py in solve() at line 38
   packages, depths = self._solve(use_latest=use_latest)
 /home/user/.local/pipx/venvs/poetry/lib/python3.6/site-packages/poetry/puzzle/solver.py in _solve() at line 180
   raise SolverProblemError(e)

pyproject.toml

[tool.poetry]
name = "my_app"
version = "0.1.1"
description = ""
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.6"
apscheduler = "3.0.5"
django = "*"
django_extensions = "*"
django_user_agents = "*"
facebook-sdk = "*"
fake_useragent = "*"
flask = "*"
flask_apscheduler_fork = "*"
helputils = "*"
lxml = "*"
numpy = "*"
paramiko = "*"
psutil = "*"
pymongo = "*"
python-digitalocean = "*"
pytz = "*"
regex = "*"
systemdunitextras = "*"
youtube_dl = "*"
watchdog = "*"
babel = "*"

[tool.poetry.dev-dependencies]

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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 12
  • Comments: 16 (3 by maintainers)

Most upvoted comments

I believe that when you update your dependencies pyproject.toml manually, you should run poetry lock to synchronize your poetry.lock with new pyproject.toml. When you try running poetry lock followed by poetry install, does it still fail?

I have found the issue, instead of adding Babel = "*" to the dependencies manually, I should run poetry add Babel. The difference is that poetry adds the version to the package, e.g. Babel = "^2.7.0". I don’t know why it doesn’t work with Babel = "*" though

Also affects me, except that this time it is tb-nightly:

[tool.poetry.dependencies]
tb-nightly = "*"
$ poetry update -vvv
Using virtualenv: /home/shared/venv/dl-torch
Updating dependencies
Resolving dependencies...
   1: fact: python.gate-detection is 0.1.0
   1: derived: python.gate-detection
   1: fact: python.gate-detection depends on tb-nightly (*)
   1: selecting python.gate-detection (0.1.0)
   1: derived: tb-nightly (*)
PyPI: 0 packages found for tb-nightly *
   1: fact: no versions of tb-nightly match *
   1: conflict: no versions of tb-nightly match *
   1: ! tb-nightly (*) is satisfied by tb-nightly (*)
   1: ! which is caused by "python.gate-detection depends on tb-nightly (*)"
   1: ! thus: version solving failed
   1: Version solving took 0.019 seconds.
   1: Tried 1 solutions.
                                                                                                                     
[SolverProblemError]                                                                                  
Because python.gate-detection depends on tb-nightly (*) which doesn't match any versions, version solving failed.  
                                                                                                                     
Exception trace:
 /home/shared/conda3/lib/python3.7/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/shared/conda3/lib/python3.7/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/shared/conda3/lib/python3.7/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/shared/conda3/lib/python3.7/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /home/shared/conda3/lib/python3.7/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /home/shared/conda3/lib/python3.7/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /home/shared/conda3/lib/python3.7/site-packages/poetry/console/commands/update.py in handle() at line 41
   return installer.run()
 /home/shared/conda3/lib/python3.7/site-packages/poetry/installation/installer.py in run() at line 73
   self._do_install(local_repo)
 /home/shared/conda3/lib/python3.7/site-packages/poetry/installation/installer.py in _do_install() at line 165
   ops = solver.solve(use_latest=self._whitelist)
 /home/shared/conda3/lib/python3.7/site-packages/poetry/puzzle/solver.py in solve() at line 38
   packages, depths = self._solve(use_latest=use_latest)
 /home/shared/conda3/lib/python3.7/site-packages/poetry/puzzle/solver.py in _solve() at line 180
   raise SolverProblemError(e)

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

poetry add shouldn’t be the only method of adding dependency, and poetry runtime should be capable of resolving the right version from wildcard. This should be a bug

Just out of curiosity: Why isn’t poetry lock a default behavior that is automatically run when running poetry install? This would be more consistent with e.g. npm, where a simple npm install is all it takes after adding dependencies manually to a package.json.

For me, I had to clear the PyPI cache to pick up the latest version of a package, then reinstall: poetry cache clear PyPI --all && rm poetry.lock && poetry install

@mdengler don’t use * for Black. It doesn’t work for some reason