Problem Description
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"
Question
Is there any way to tell pip to use double instead of single quotes? Any other ideas for how to overcome this problem?
Edits
- In the meantime, I've also tried Python 3.8.2 with pip 20.1, and got the same error
error: file 'C:\...\bin\some-script' does not exist
. What is this script, is it part of the project being installed? Is it properly packaged? Is it in the git repository? – Inventorgit
command doesn't work if directly executed — were a red herring, and the actual problem was that mysetup.py
had a typo in one of thescripts
it claimed to publish. Feel free to post a short, corresponding answer, I'll accept it then. If not, I'll answer my own question. – Mohock