poetry install bad python version

Created on 30 Apr 2018  路  5Comments  路  Source: python-poetry/poetry

If poetry is installed with python 3.6, when you specifiy python2.7 in [tool.poetry.dependencies] it will create a virtualenv under python 3.6.
I know it's the intended behaviour (it's in the doc) but I think It's a real issue.

So poetry should check while creating virtualenv that the python version are not compatible (or not the expected one).
Good idea are every where and the pipenv way (specify --python 3.6 or - python 2.7) is maybe a good way to do it.

thanks for poetry

CLI Feature

Most helpful comment

I think poetry should at least give an error rather than creating an invalid virtualenv, otherwise what's the point of the python dependency option in the first place?

All 5 comments

I think poetry should at least give an error rather than creating an invalid virtualenv, otherwise what's the point of the python dependency option in the first place?

maybe something like this :
```poetry install
Warning : THe current python version is not supported in pyproject.toml, do you want to continue ?(y/n).

and/ or

poetry run something
warning: you're running under a python version not supported in pyproject.toml
```

@jgirardet @rainyday Thanks both of you for your input. I agree that poetry should give some kind of feedback that there is an incompatibility. I will try to add it to the next feature release (`0.9.0')

And @rainyday the purpose of the python dependency is to declare for which Python versions your project is compatible with. This is particularly useful if you publish it.

I can propose some help if you want

I am running into this too.

Was this page helpful?
0 / 5 - 0 ratings