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)
I believe that when you update your dependencies
pyproject.toml
manually, you should runpoetry lock
to synchronize yourpoetry.lock
with newpyproject.toml
. When you try runningpoetry lock
followed bypoetry install
, does it still fail?I have found the issue, instead of adding
Babel = "*"
to the dependencies manually, I should runpoetry 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 withBabel = "*"
thoughAlso affects me, except that this time it is tb-nightly:
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 bugJust out of curiosity: Why isn’t
poetry lock
a default behavior that is automatically run when runningpoetry install
? This would be more consistent with e.g. npm, where a simplenpm install
is all it takes after adding dependencies manually to apackage.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