`poetry update` AttributeError: 'EmptyConstraint' object has no attribute 'allows'
See original GitHub issue- 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). Gist of output is: https://gist.github.com/mdengler/7be12f9c481567c7872bc2ea712464b6
- OS version and name: Fedora 34
$ cat /etc/fedora-release
Fedora release 34 (Thirty Four)
- Poetry version: Poetry version 1.1.6
$ poetry --version
Poetry version 1.1.6
- Link of a Gist with the contents of your pyproject.toml file: Unpublished software, so if there is a need for this file, I can provide privately.
Issue
I have received this error message:
$ poetry update
Updating dependencies
Resolving dependencies... (34.4s)
Writing lock file
AttributeError
'EmptyConstraint' object has no attribute 'allows'
at ~/.local/lib/python3.9/site-packages/poetry/core/version/markers.py:291 in validate
287│
288│ if self._name not in environment:
289│ return True
290│
→ 291│ return self._constraint.allows(self._parser(environment[self._name]))
292│
293│ def without_extras(self): # type: () -> MarkerTypes
294│ return self.exclude("extra")
295│
I made this change as a workaround:
$ diff -uw ~/.local/lib/python3.9/site-packages/poetry/core/version/markers.py{~,}
--- /home/martin/.local/lib/python3.9/site-packages/poetry/core/version/markers.py~ 2021-04-21 11:44:56.085692322 -0400
+++ /home/martin/.local/lib/python3.9/site-packages/poetry/core/version/markers.py 2021-08-19 11:38:17.934769254 -0400
@@ -288,6 +288,9 @@
if self._name not in environment:
return True
+ if not hasattr(self._constraint, "allows"):
+ return True
+
return self._constraint.allows(self._parser(environment[self._name]))
def without_extras(self): # type: () -> MarkerTypes
$ diff -uw ~/.local/lib/python3.9/site-packages/poetry/core/version/markers.py{~,}
--- /home/martin/.local/lib/python3.9/site-packages/poetry/core/version/markers.py~ 2021-04-21 11:44:56.085692322 -0400
+++ /home/martin/.local/lib/python3.9/site-packages/poetry/core/version/markers.py 2021-08-19 11:38:17.934769254 -0400
@@ -288,6 +288,9 @@
if self._name not in environment:
return True
+ if not hasattr(self._constraint, "allows"):
+ return True
+
return self._constraint.allows(self._parser(environment[self._name]))
def without_extras(self): # type: () -> MarkerTypes
I gathered some extra debugging information that points to greenlet
and sqlalchemy
as being involved in the issue: https://gist.github.com/mdengler/7be12f9c481567c7872bc2ea712464b6
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:12
Top Results From Across the Web
'EmptyConstraint' object has no 'allows' Attribute error fix? - Replit
Updating dependencies. Resolving dependencies... Writing lock file. AttributeError. 'EmptyConstraint' object has no attribute 'allows'.
Read more >'EmptyConstraint' object has no 'allows' Attribute error fix?
Updating dependencies. Resolving dependencies... Writing lock file. AttributeError. 'EmptyConstraint' object has no attribute 'allows'.
Read more >Installing SQLAlchemy with Poetry causes an AttributeErrorr
I tried fl_'s answer but poetry self update itself failed for me with an error saying: ModuleNotFoundError: No module named 'poetry.console'.
Read more >'EmptyConstraint' object has no attribute 'min' with pytest and ...
[x] I am on the latest Poetry version. [x] I have searched the issues of this repo and believe that this is not...
Read more >Installing SQLAlchemy with Poetry causes an AttributeErrorr
... for SQLAlchemy Updating dependencies Resolving dependencies... (0.1s) AttributeError 'EmptyConstraint' object has no attribute 'allows' ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the same issue with the current preview build, poetry
1.2.0a2
Will there be another preview build that fixes it?
Upgrading poetry to 1.1.8 may solve the issue. Check #4402 for for more information.