Reputation: 12852
Using Python 3.7.6 on Windows 10, I'm trying to upgrade a package installed directly from a git repository:
pip install --upgrade git+https://url.of.my/py/package.git
The installation then fails:
...
error: file 'C:\Users\myuser\AppData\Local\Temp\pip-req-build-ip4k0pfs\bin\some-script' does not exist
...
As far as I've been able to work out, for the following reason: early on, pip calls
git clone -q https://url.of.my/py/package.git 'C:\Users\myuser\AppData\Local\Temp\pip-req-build-ip4k0pfs'
i.e. it checks out the repository into a temporary directory. However, the directory isn't created and no sources are checked out. Indeed, when I run the command on the Windows command line (I've also tried Git Bash and MSYS2 Bash, same problem), I get an error:
C:\Users\myuser>git clone -q https://url.of.my/py/package.git 'C:\Users\myuser\AppData\Local\Temp\pip-req-build-ip4k0pfs'
fatal: could not create leading directories of ''C:\Users\myuser\AppData\Local\Temp\pip-req-build-ip4k0pfs'': Invalid argument
The problem are the single quotes around the path to the temporary directory. Changing them to double quotes makes the error disappear:
C:\Users\myuser>git clone -q https://url.of.my/py/package.git "C:\Users\myuser\AppData\Local\Temp\pip-req-build-ip4k0pfs"
Is there any way to tell pip to use double instead of single quotes? Any other ideas for how to overcome this problem?
Upvotes: 2
Views: 1260
Reputation: 21
I had the same problem and did not have the same underlying issue. The issue is resolved by using git bash (MINGW), which handles the quotes correctly.
Upvotes: 2
Reputation: 12852
As @sinoroc suspected, the quotes — or rather, the fact that the logged git command doesn't work if directly executed — were a red herring, and the actual problem was that my setup.py
had a typo: the scripts
list included a file named bin/some-script
, which was actually named bin/some-script.py
, and thus couldn't be found.
Upvotes: 3