poetry shell in git bash on Windows broken since 1.2.0
See original GitHub issue- [x ] I am on the latest Poetry version.
- [x ] I have searched the issues of this repo and believe that this is not a duplicate.
- [ x] If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: Windows 11, git 2.33.1.windows.1
- Poetry version: 1.2.0
- Link of a Gist with the contents of your pyproject.toml file: Not relevant
Issue
Since poetry 1.2.0, poetry shell does not work on git bash in Windows.
$ poetry shell
Spawning shell within C:\Users\filip\AppData\Local\pypoetry\Cache\virtualenvs\dinrplan-9Ih6xyvL-py3.10
/usr/bin/bash: /K: No such file or directory
Downgrading to 1.1.5 works:
filip@Marwin MINGW64 ~/workspace/python/dinrplan (master)
$ poetry --version
Poetry version 1.1.15
filip@Marwin MINGW64 ~/workspace/python/dinrplan (master)
$ poetry shell
Spawning shell within C:\Users\filip\AppData\Local\pypoetry\Cache\virtualenvs\dinrplan-T1RTjXIi-py3.9
filip@Marwin MINGW64 ~/workspace/python/dinrplan (master)
$ which python
/c/Users/filip/AppData/Local/pypoetry/Cache/virtualenvs/dinrplan-T1RTjXIi-py3.9/Scripts/python
Looking at the code, I believe 57450f2717 broke the git bash support.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
`Latest version already installed` but `poetry: command not ...
Completely wiped my PC,; Tried Anaconda and Miniconda versions (installing and uninstalling),; Setup Conda with Git Bash,; Experimented with WSL ...
Read more >Announcing Poetry 1.2.0 | Blog
Since there are many changes in Poetry 1.2.0, this post details the changes over the following sections: Breaking changes and major features ...
Read more >Configuration - Starship: Cross-Shell Prompt
If you are running Starship in bash , do not hook the DEBUG trap after running eval $(starship init $0) , or this...
Read more >Changelog - tmuxp 1.19.0a0 documentation
To install the unreleased tmuxp version, see developmental releases. pip: pipx: tmuxp 1.19.x (unreleased): What's new: Environment variables for windows ...
Read more >Setting up Python Projects: Part II | by Johannes Schmidt
OS: Linux, Unix, macOS, Windows (WSL2 with e.g. Ubuntu 20.04 LTS) · Tools: python3.10, bash, git, tree, awk · Version Control System (VCS)...
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

@cbehopkins
From previous poetry brokenness, I ended up having a shell alias to do the right thing.
alias pshell='poetry run bash -i'You can also hardcode which bash you want to run if you want to run.
Keep in mind that at least in my case, on Windows, poetry changed the virtual env it installs to. So if you were using 1.1.15 and upgraded to 1.2.0 or later, you’ll want to check to make sure your IDE points to the right virtualenv for your python interpreter.
The identification point is correct. For windows, we are only considering Powershell or cmd.exe. I’ll add a third case to fallback to the previous behavior. The prompt modification won’t happen in this situtation.
Here is what shellingham reports