You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 Pro
Poetry version: 1.1.13
Link of a Gist with the contents of your pyproject.toml file: None (This is poetry new issue.)
Issue
When I run poetry new in the parent directory of the directory where Git is installed, I get the following error:
C:\Users\personal>poetry new poetry_demo
RuntimeError
Unable to find a valid git executable
at AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\core\vcs\git.py:189 in executable
185│ else:
186│ _executable = "git"
187│
188│ if _executable is None:
→ 189│ raise RuntimeError("Unable to find a valid git executable")
190│
191│ return _executable
192│
193│
If it is not the parent directory of Git, no error will occur.
C:\Users\personal>mkdir tmp_dir
C:\Users\personal>cd tmp_dir
C:\Users\personal\tmp_dir>poetry new poetry-demo
Created package poetry_demo in poetry-demo
The code that causes is as follows
If ValueError is not raised (i.e., if the git path can be converted to a path relative to the current directory), the next process raises RuntimeError.
poetry/core/vcs/git.py
ifWINDOWSandPY36:
# Finding git via where.exewhere="%WINDIR%\\System32\\where.exe"paths=decode(
subprocess.check_output([where, "git"], shell=True, encoding="oem")
).split("\n")
forpathinpaths:
ifnotpath:
continuepath=Path(path.strip())
try:
path.relative_to(Path.cwd())
exceptValueError:
_executable=str(path)
breakelse:
_executable="git"if_executableisNone:
raiseRuntimeError("Unable to find a valid git executable")
I don't know the details of this function, but I think the error message should say that 'the poetry project cannot be created in the parent directory of "git.exe"'.
This is my first Issue, so I apologize if anything is incomplete.
I hope this helps.
The text was updated successfully, but these errors were encountered:
I'm having the exact same issue with poetry 1.4.0 on Windows. The calling stack is the same as above. And I think dulwich didn't help solve this issue.
-vvv
option).poetry new
issue.)Issue
When I run
poetry new
in the parent directory of the directory where Git is installed, I get the following error:The path to Git is as follows:
If it is not the parent directory of Git, no error will occur.
The code that causes is as follows
If
ValueError
is not raised (i.e., if the git path can be converted to a path relative to the current directory), the next process raisesRuntimeError
.poetry/core/vcs/git.py
I don't know the details of this function, but I think the error message should say that 'the poetry project cannot be created in the parent directory of "git.exe"'.
This is my first Issue, so I apologize if anything is incomplete.
I hope this helps.
The text was updated successfully, but these errors were encountered: