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.

Expose Poetry's virtualenv

See original GitHub issue

If the user doesn’t have an active virtualenv, Poetry is already creating and using a default per-project virtualenv behind the scenes. There is no easy way to get to it after it’s created.

If you’d be willing to accept a PR to this effect, I’d be happy to contribute the following:

  • add a poetry shell command equivalent to pipenv shell
  • make poetry add/remove/install output the path to the virtualenv that it’s using if there is no active virtualenv

I know that your current available alternative is poetry run. My problem with it is that it gets verbose fast. poetry run python -m X instead of just X in an activated virtualenv.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:31
  • Comments:28 (18 by maintainers)

github_iconTop GitHub Comments

9reactions
ambvcommented, Jun 10, 2018

I don’t use Windows so I’ll leave that part as an exercise to the reader.

6reactions
jaroelcommented, Jun 14, 2018

Here’s a workaround to get it: $ poetry run which python /Users/roel/Library/Caches/pypoetry/virtualenvs/koei-py3.6/bin/python

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing environments | Documentation - Poetry
If you use a tool like pyenv to manage different Python versions, you can set the experimental virtualenvs.prefer-active-python option to true .
Read more >
Python Poetry for Building Docker Images - Binx
The poetry stage installs Poetry, and uses it to install the Python application and its dependencies in a virtual environment. The runtime stage ......
Read more >
How to use poetry with docker? - Stack Overflow
By default, poetry creates a virtual environment in $HOME/.cache/pypoetry/virtualenvs to isolate the system interpreter from your application.
Read more >
Python Virtual Environments tutorial using Virtualenv and Poetry
A mini-guided Python tutorial showing how to use virtual environment and why it's matters on virtualenv and poetry illustrated examples.
Read more >
A Poetic Apology. Or Why Should You Use Poetry to Manage…
Poetry is a CLI app written in Python so you can simply install it with pip install --user poetry . However, you probably...
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