No method to control the python version used
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).
- OS version and name: Windows 10
- Poetry version: 0.12.2
Issue
I found it confusing when my pyproject.toml
file says python = "3"
and yet a Python 2.7 venv was being created.
I then noticed
The created virtualenv will use the Python executable for which poetry has been installed. on https://poetry.eustace.io/docs/basic-usage/
I assumed it was using the version of python I ran get-poetry
with. I tried again with python3
and still no luck.
It seems its just hard coded in poetry.bat
as python
and for me to change, I need to change that file.
To me, the ideal thing would be to a way to get arbitrary versions of python, like tox, and allow it to be configured on a per-project basis (like as a dev-dependency).
Workround
Edit poetry.bat
to change what python gets invoked.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:24
- Comments:34 (11 by maintainers)
Top Results From Across the Web
How Should I Set Default Python Version In Windows?
This is if you have both the versions installed. Go to This PC → Right-click → Click on Properties → Advanced System Settings....
Read more >Managing Multiple Python Versions With pyenv
In this step-by-step tutorial, you'll learn how to install multiple Python versions and switch between them with ease, including project-specific virtual ...
Read more >How to manage multiple Python versions and virtual ...
If you wish to use multiple versions of Python on a single machine, then pyenv is a commonly used tool to install and...
Read more >tkinter — Python interface to Tcl/Tk — Python 3.11.1 ...
Tkinter supports a range of Tcl/Tk versions, built either with or without thread support. ... Tk uses Tcl's event queue to generate and...
Read more >Working with the AWS CDK in Python
The Python version of the AWS CDK even uses Python-style identifiers (for example, snake_case method names). You can use any editor or IDE....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
@epage
This is no longer true (I forgot to update this part of the documentation).
As of version
0.12.0
, thepoetry
script will use the currently activated Python version to create the virtualenv.Basically, you want to use a tool like
pyenv
to switch between Python versions, or use a project-specific.python-version
so thatpyenv
knows which Python version you want for your project.Making Poetry a Python versions manager is not a direction I want to go in since there are tools that do it already.
Looks like we’ll get what we need when 1.0 releases: https://github.com/sdispater/poetry/pull/731 has already been merged in and provides
poetry env use /full/path/to/python