Using Python 3 with Poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
The only problem is that for some reason Poetry doesn’t use Python version 3 by default for any project that you create using it and it doesn't run virtual environment shell using Python 3 even if the min required version of python is set to
3.x for the project. See issue for more details.
A quick, safe and dirty (because you will have to do this every time you update Poetry version) way to fix this is given below.
~/.poetry/bin/poetry in editor of your choice. I’ll use nano :
Top line of the file will be:
Update it to:
Now Poetry should work as expected i.e run virtual environment shell using Python 3 etc.
Note: I think this will probably break things when you set min required version of Python to
2.xfor your project. I have not tested this for Python 2. Python 2 has been deprecated anyway. Let me know in the comments if there is a better way to do it.