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

Fix invalid path error on pip install for Windows #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deton
Copy link

@deton deton commented Aug 6, 2023

Problem

pip install fails with an invalid path error on Windows
because of a file name that contains the reserved character *.

pip install git+https://github.com/nsh87/regressors.git

Collecting git+https://github.com/nsh87/regressors.git
  Cloning https://github.com/nsh87/regressors.git to c:\users\x\appdata\local\temp\pip-req-build-9h5c0ebe
  Running command git clone --filter=blob:none --quiet https://github.com/nsh87/regressors.git 'C:\Users\x\AppData\Local\Temp\pip-req-build-9h5c0ebe'
  error: invalid path '.editorconfig*.py'
  fatal: unable to checkout working tree
  warning: Clone succeeded, but checkout failed.
  You can inspect what was checked out with 'git status'
  and retry with 'git restore --source=HEAD :/'

  error: subprocess-exited-with-error

  × git clone --filter=blob:none --quiet https://github.com/nsh87/regressors.git 'C:\Users\x\AppData\Local\Temp\pip-req-build-9h5c0ebe' did not run successfully.
  │ exit code: 128
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

or

pip install https://github.com/nsh87/regressors/archive/master.zip
Collecting https://github.com/nsh87/regressors/archive/master.zip
  Downloading https://github.com/nsh87/regressors/archive/master.zip
     | 421.6 kB 1.8 MB/s 0:00:00
ERROR: Could not install packages due to an OSError: [Errno 22] Invalid argument: 'C:\\Users\\x\\AppData\\Local\\Temp\\pip-req-build-l9tmy2kt\\.editorconfig*.py'

Cause

*(asterisk) character cannot be used in file name on Windows.

Solution

This pull-request removes .editorconfig*.py.
(.editorconfig file has same content.)

Reference

https://confluence.atlassian.com/bitbucketserverkb/error-invalid-path-during-git-clone-to-windows-client-1085186345.html

Remark

To try this branch, please specify zip on pip install.

pip install https://github.com/deton/regressors/archive/fix-invalid-path-error-on-windows.zip

Specifying git+https fails yet
because checkout of the specified branch is executed after git clone.

pip install git+https://github.com/deton/regressors.git@fix-invalid-path-error-on-windows
  git clone https://github.com/deton/regressors.git ...
  git checkout -b fix-invalid-path-error-on-windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant