poetry default to using python instead of python3
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.
-
[n/a ] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option). -
OS version and name: macOS big sur
-
Poetry version: 1.1.2
-
python3.8 installed with home-brew
Issue
when creating a new project with poetry it sets the python version as python 2.7 by default rather than using the latest available version.
It also ironically prints the warning:
Python 2.7 will no longer be supported in the next feature release of Poetry (1.2).
You should consider updating your Python version to a supported one.
Note that you will still be able to manage Python 2.7 projects by using the env command.
See https://python-poetry.org/docs/managing-environments/ for more information.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Change python version to 3.x - Stack Overflow
The default python will end up in the pyproject.toml file and you'll need ... You could also use poetry new instead of poetry...
Read more >Introduction | Documentation | Poetry - Python dependency ...
Poetry is a tool for dependency management and packaging in Python. ... Note: On some systems, python may still refer to Python 2...
Read more >How To Install Poetry to Manage Python Dependencies on ...
Poetry is a dependency manager for Python that is also capable of building and packaging your Python projects for distribution.
Read more >Configure a Poetry environment | PyCharm Documentation
To use Poetry in PyCharm, you need to install it on your machine and create a specific Python ... curl -sSL https://install.python-poetry.org |...
Read more >Dependency Management With Python Poetry
When your Python project relies on external packages, you need to make sure you're using the right version of each package.
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
The issue here is that the poetry executable has
python
in its shebang, which is annoying. I don’t remember exactly where it gets installed, but lets say it is/usr/bin/poetry
, you can get this path with$ which poetry
. If you edit the shebang in that executable and replace it with!/usr/bin/env python3
instead of!/usr/bin/env python
it will work.This is a hack and not a solution. I don’t know why this is not the default behavior.
How about simply changing the following line in get-poetry.py
to
This first tries Python 3, which doesn’t spit out a big warning message. In fact, this is how it is done for Windows: