Running deactivate inside a poetry shell breaks it
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.
-
OS version and name: macOS Catalina
-
Poetry version: 1.0.5
Issue
After running poetry shell
I tried to exit running deactivate
. That deactivated the virtualenv, that is, I was not able to access anymore the version of de libs installed for my project.
But when I tried to run poetry shell
again, I got this message:
Virtual environment already activated...
Then I discovered I should exit using the exit
command.
I think the deactivate
command should be disabled inside the poetry shell.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Basic usage | Documentation | Poetry - Python dependency ...
There are several ways to run commands within this virtual environment. ... To deactivate the virtual environment and exit this new shell type...
Read more >The virtual environment found seems to be broken | python ...
In my case, I am using python 3.7 sudo apt-get install python3.7-venv. Other way is to disable virtual environment poetry config ...
Read more >Working on a project - Copier Poetry - pawamoy's website
Use poetry run CMD [ARGS...] to run a command in the virtualenv. Use poetry shell to activate/enter the virtualenv, and exit to deactivate/exit...
Read more >Pipenv: promises a lot, delivers very little | Chris Warrick
I create ~/git/website and run pipenv install Django in that ... exit or ^D. If you type deactivate , you are working with...
Read more >Dependency Management With Python Poetry
Pin Dependencies in poetry.lock; Install Dependencies From poetry. ... You can run poetry --version in your terminal to see if poetry works.
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 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
Hello,
the reason for this behavior is, that
poetry shell
does two things:The command
deactivate
is provided by the venv andexit
is provided by the shell itself.poetry
has no influence on that commands.So to leave the env and the shell using
exit
is the intended way.fin swimmer
Yup. Sorry, I didn’t get an email for this until now so I didn’t know I got a go. I’ll add it by today and submit the PR.