-vvv option).Hi! This is my first time attempting to use poetry. I created a new empty project with this command:
$ poetry new example
Then, from within the example directory, I attempt to add the jupyter package:
$ poetry add jupyter
Using version ^1.0 for jupyter
Updating dependencies
Resolving dependencies... (4.0s)
[AttributeError]
EmptyConstraint instance has no attribute 'min'
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...
Verbose output is contained within the gist linked above. I am able to add other packages without apparent error. Happy to provide additional info.
Update: When I use pyenv to explicitly set the local Python version to 3 (I tried both 3.6.5 and 3.7.0), I _am_ able to add the jupyter package.
$ poetry new example
$ cd example
$ pyenv local 3.6.5
$ poetry add jupyter # installs fine
This fails with the same AttributeError as above if I instead use pyenv local 2.7.10.
I can install jupyter directly using pip and Python 2.7:
$ mkdir example
$ cd example
$ pyenv local 2.7.10
$ python -m pip install --upgrade pip
$ python -m pip install jupyter # installs fine
There was an issue when parsing some transitive markers. It has been fixed in commit 7761867
This has been fixed in the latest release.
Thank you!
On Mon, Oct 22, 2018 at 7:08 PM Sébastien Eustace notifications@github.com
wrote:
Closed #534 https://github.com/sdispater/poetry/issues/534.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/sdispater/poetry/issues/534#event-1918817992, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABIVaXpKGlHCIOw-6UzEPNG3vjhOTMs-ks5unk_VgaJpZM4XwqLv
.
I think there's been a regression here; I get the same error with 0.12.16:
```console
$ poetry -V
Poetry 0.12.16
$ poetry add jupyter
[AttributeError]
'EmptyConstraint' object has no attribute 'min'
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--]
Got the same error with 0.12.17 & Python version 3.7.4; same prompt as @flaviut 's comment.
It seems to be create_nested_marker() missing EmptyConstraint when checking the type of constraint. Manual patching ~/.poetry/lib/poetry/packages/utils/utils.py to import poetry.semver.empty_constraint.EmptyConstraint and add it to check list said above solved the problem locally.
Also getting this error with Poetry 0.12.17. Can we re-open this issue?
@mwoyuan to which check (line #?) did you add EmptyConstraint? Maybe submit a PR if you were able to patch it?
EDIT: added EmptyConstraint import after line 9:
from poetry.semver import Version
from poetry.semver import VersionUnion
from poetry.semver.empty_constraint import EmptyConstraint # this line is new
and a new if statement after line 206/207:
elif isinstance(constraint, Version):
marker = '{} == "{}"'.format(name, constraint.text)
elif isinstance(constraint, EmptyConstraint): # and this line
marker = '' # and this one
else:
And now it seems to work ok
Met this issue on Poetry 1.0.3 + Python 3.7.4
I'm having the same error on Poetry 1.0.9.
The package I'm trying (AuHau/toggl-cli) has:
python_requires = >=3.6.0, <3.9.0
This is my debug info, and a gist below with pyproject.toml and the full error log.
Poetry
Version: 1.0.9
Python: 3.8.3
Virtualenv
Python: 3.8.3
Implementation: CPython
Path: /Users/wagneraugusto/Library/Caches/pypoetry/virtualenvs/toggl-cli-bug-t9z0mPRw-py3.8
Valid: True
System
Platform: darwin
OS: posix
Python: /Users/wagneraugusto/.pyenv/versions/3.8.3
Poetry [AttributeError] 'EmptyConstraint' object has no attribute 'min'
Most helpful comment
Met this issue on Poetry 1.0.3 + Python 3.7.4