Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Environment Does Not Appear Next to Path in Shell #2793

Closed
3 tasks done
adam-grant-hendry opened this issue Aug 10, 2020 · 4 comments · Fixed by #5053
Closed
3 tasks done

Virtual Environment Does Not Appear Next to Path in Shell #2793

adam-grant-hendry opened this issue Aug 10, 2020 · 4 comments · Fixed by #5053
Labels
area/ux Features and improvements related to the user experience area/venv Related to virtualenv management kind/bug Something isn't working as expected

Comments

@adam-grant-hendry
Copy link

adam-grant-hendry commented Aug 10, 2020

  • 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, Version 1809>
  • Poetry version: <1.1.0a3>
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

Moved #2788 to Bug as activate scripts within virtual environment folder indicate virtual environment name is supposed to appear next to path in parentheses (as is typical when using, e.g., virtualenv). This does not work (at least for Windows Command Prompt).

Action:

C:\Users\example\Desktop\Project>poetry shell

Expected Result:

Spawning shell within C:\Users\example\AppData\Local\pypoetry\Cache\virtualenvs\project-####-py#.#
Microsoft Windows [Version 10.0.17763.1339]
(c) 2018 Microsoft Corporation. All rights reserved.

(project-####-py#.#) C:\Users\example\Desktop\Project>

Actual Result:

Spawning shell within C:\Users\example\AppData\Local\pypoetry\Cache\virtualenvs\project-####-py#.#
Microsoft Windows [Version 10.0.17763.1339]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\example\Desktop\Project>
@adam-grant-hendry adam-grant-hendry added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 10, 2020
@adam-grant-hendry
Copy link
Author

adam-grant-hendry commented Aug 10, 2020

Update: Using VSCode, I can set

"python.venvPath": "C:\\Users\\example\\AppData\\Local\\pypoetry\\Cache\\virtualenvs"

in user settings. Now, upon opening VSCode, the activate.batch script is run and the virtual environment appears in parentheses next to the path and I can use the commands activate and deactivate to display and remove, resp., the virtual environment next to the path.

However, after running deactivate, entering poetry env list in my project directory shows:

(project-####-py#.#) (Activated)

I see this was noted in #2387, however this feels counter intuitive from common usage of virtual environments and leaves me unsure as to whether the environment is truly active or not.

@finswimmer finswimmer added area/ux Features and improvements related to the user experience area/venv Related to virtualenv management labels Aug 12, 2020
@venaturum
Copy link
Contributor

+1 on this issue

@hms5232
Copy link

hms5232 commented Aug 6, 2021

Poetry version 1.1.7 has same problem on Windows 10 1909 (build 18363.1556).
Any solution or idea?

@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/ux Features and improvements related to the user experience area/venv Related to virtualenv management kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants