-
Notifications
You must be signed in to change notification settings - Fork 1
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
Allow --force
activate poetry shell
when poetry fails to activate it
#14
Comments
if shell:
if activated:
print("Virtual environment already activated: ...")
else:
print("Poetry shell is already running and virtual environment is deactivated. Exit shell and run again.")
return 0
# create shell and activate venv |
It's difficult to know if such a shell is active, and whether it is actually the poetry shell that is active or some other shell. Running |
This should be more documented! If I do |
This is a tricky business as we are very limited in what we can do to affect a parent process. Poetry starts a subshell as a compromise -- maybe we could print a message about it being a subshell when we spawn it. Another feature worth considering is a |
I loved Poetry but this is a serious issue that needs to be solved. It should be easier to deactivate the environment running in the subprocess with a simple command outside of the shell. Instead I need to find the Python path and deactivate it manually: Also, huge bummer that I'm unable to run multiple of the same environments at once: Will be moving away from Poetry for now. |
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: Ubuntu 20.04
Poetry version: 1.1.13
Issue
Often times
poetry
keeps thinking I have a shell already activated, and I don't. This is widely reported by others too (#4622, #21, python-poetry/poetry#5050, python-poetry/poetry#3136). I also do not have any conda environment activated (not evenbase
). In this case, I am just forced to use the full path to thevenv
to run theactivate
script manually. I propose that we should be able to do this inpoetry
, when it inevitable fails to activate the venv, to--force
activate the environment, so that even if it is "already active" (not actually), it will still be "activated" (for the first time).Current output
Proposed Usage example:
The text was updated successfully, but these errors were encountered: