question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 5 years ago
  • Reactions:24
  • Comments:34 (11 by maintainers)

github_iconTop GitHub Comments

35reactions
sdispatercommented, Oct 18, 2018

@epage

The created virtualenv will use the Python executable for which poetry has been installed. on https://poetry.eustace.io/docs/basic-usage/

This is no longer true (I forgot to update this part of the documentation).

As of version 0.12.0, the poetry 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 that pyenv 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.

23reactions
CptSpaceToastercommented, May 14, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found