threads / discuss / 45851

CYGWIN git cannot install python packages with pip

Subject: CYGWIN git cannot install python packages with pip

## tl;dr

10 messages between May 2, 2017 and May 16, 2017.

replies: 9people: 3as markdown or json

ankostis· May 2, 2017, 18:08 UTC · lore
On Windows, with Cygwin-git 02.12.2-1 the python command:
    pip install git+https://github.com/...`
fails to work with the following error:
    $ pip install git+https://github.com/ipython/traitlets/
    Collecting git+https://github.com/ipython/traitlets/
    Cloning https://github.com/ipython/traitlets/ to c:\users\username\appdata
\local\temp\pip-kjwxq_oy-build
    fatal: Invalid path '/cygdrive/d/Work/ALLINONES2/co2mpas_AIO-v1.6.0/CO2MPA
S/C:\Users\username\AppData\Local\Temp\pip-kjwxq_oy-build': No such file or di
rectory
    git clone -q https://github.com/ipython/traitlets/ C:\Users\user\AppData\L
ocal\Temp\pip-kjwxq_oy-build" failed with error code 128 in None
Git-2.8.3 had no such problem.
Any ideas?
ankostis· May 2, 2017, 18:40 UTC · re: ankostis · lore

Re: CYGWIN git cannot install python packages with pip

Note that MSYS2 Git-12.2.1 also has no such problem.
On 2 May 2017 at 20:08, ankostis <ankostis@gmail.com> wrote:
Show 11 quoted lines
> On Windows, with Cygwin-git 02.12.2-1 the python command:
>
>     pip install git+https://github.com/...`
>
> fails to work with the following error:
>
> ...
>
> Git-2.8.3 had no such problem.
>
> Any ideas?
Johannes Schindelin· May 3, 2017, 09:47 UTC · re: ankostis · lore

Re: CYGWIN git cannot install python packages with pip

Hi,
On Tue, 2 May 2017, ankostis wrote:
> On Windows, with Cygwin-git 02.12.2-1 the python command:
>
> [...]

You forgot to mention what python/pip you use (is it the Cygwin one, or a standalone one?). Intentional?

Ciao, Johannes

ankostis· May 3, 2017, 10:21 UTC · re: Johannes Schindelin · lore

Re: CYGWIN git cannot install python packages with pip

On 3 May 2017 11:47, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 7 quoted lines
> On Tue, 2 May 2017, ankostis wrote:
>
>> On Windows, with Cygwin-git 02.12.2-1 the python command:
>> [...]
>
> You forgot to mention what python/pip you use (is it the Cygwin one, or a
> standalone one?). Intentional?

I have tested it on using WinPython[1] 3.6.1 & 3.5.3. WinPython is built out of the "standard" python on Windows.

Judging by the error, the problem is on the temporary folder used as target. For some reason, Git uses $HOME as a prefix to the temporary folder selected by `pip`.

My home in the above case above is this: /cygdrive/d/Work/ALLINONES2/co2mpas_AIO-v1.6.0/CO2MPAS

Thanks,
  Kostis
[1] http://winpython.github.io/
Johannes Schindelin· May 3, 2017, 14:32 UTC · re: ankostis · lore

Re: CYGWIN git cannot install python packages with pip

Hi,
On Wed, 3 May 2017, ankostis wrote:
Show 11 quoted lines
> On 3 May 2017 11:47, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > On Tue, 2 May 2017, ankostis wrote:
> >
> >> On Windows, with Cygwin-git 02.12.2-1 the python command:
> >> [...]
> >
> > You forgot to mention what python/pip you use (is it the Cygwin one,
> > or a standalone one?). Intentional?
> 
> I have tested it on using WinPython[1] 3.6.1 & 3.5.3.
> WinPython is built out of the "standard" python on Windows.

I am afraid that you run into path conversion problems here. /cygdrive/d/ is something Cygwin understands, but not WinPython nor Git for Windows.

It appears to be difficult to impossible to mix Cygwin with non-Cygwin executables...

Ciao, Johannes

Adam Dinwoodie· May 4, 2017, 09:47 UTC · re: Johannes Schindelin · lore

Re: CYGWIN git cannot install python packages with pip

On Wed, May 03, 2017 at 04:32:15PM +0200, Johannes Schindelin wrote:
Show 19 quoted lines
> On Wed, 3 May 2017, ankostis wrote:
> 
> > On 3 May 2017 11:47, Johannes Schindelin wrote:
> > > On Tue, 2 May 2017, ankostis wrote:
> > >
> > >> On Windows, with Cygwin-git 02.12.2-1 the python command:
> > >> [...]
> > >
> > > You forgot to mention what python/pip you use (is it the Cygwin one,
> > > or a standalone one?). Intentional?
> > 
> > I have tested it on using WinPython[1] 3.6.1 & 3.5.3.
> > WinPython is built out of the "standard" python on Windows.
> 
> I am afraid that you run into path conversion problems here. /cygdrive/d/
> is something Cygwin understands, but not WinPython nor Git for Windows.
> 
> It appears to be difficult to impossible to mix Cygwin with non-Cygwin
> executables...
Confirmed: the Cygwin project as a general rule doesn't support this
sort of mixing of Windows and Cygwin tools.  Either use Python and Git
packages both provided by Cygwin, or both provided by Windows.

Mixing and matching does work sometimes -- as was apparently the case with Cygwin Git v2.8.3-1 -- but it requires care and you're generally on your own with it.

Adam
ankostis· May 4, 2017, 10:18 UTC · re: Adam Dinwoodie · lore

Re: CYGWIN git cannot install python packages with pip

On 4 May 2017 at 11:47, Adam Dinwoodie <adam@dinwoodie.org> wrote:
Show 7 quoted lines
> Confirmed: the Cygwin project as a general rule doesn't support this
> sort of mixing of Windows and Cygwin tools.  Either use Python and Git
> packages both provided by Cygwin, or both provided by Windows.
>
> Mixing and matching does work sometimes -- as was apparently the case
> with Cygwin Git v2.8.3-1 -- but it requires care and you're generally on
> your own with it.

MSYS2's git-2.12.1 also works fine, so there must be something different in this build of git that breaks this long-standing capability.

Judging from the error-message, it somehow concatenates input & output paths. Isn't this something to research about?

Regards, for your continuous effort,
  Kostis
Johannes Schindelin· May 4, 2017, 11:26 UTC · re: ankostis · lore

Re: CYGWIN git cannot install python packages with pip

Hi,
On Thu, 4 May 2017, ankostis wrote:
Show 11 quoted lines
> On 4 May 2017 at 11:47, Adam Dinwoodie <adam@dinwoodie.org> wrote:
> > Confirmed: the Cygwin project as a general rule doesn't support this
> > sort of mixing of Windows and Cygwin tools.  Either use Python and Git
> > packages both provided by Cygwin, or both provided by Windows.
> >
> > Mixing and matching does work sometimes -- as was apparently the case
> > with Cygwin Git v2.8.3-1 -- but it requires care and you're generally on
> > your own with it.
> 
> MSYS2's git-2.12.1 also works fine, so there must be something
> different in this build of git that breaks this long-standing capability.

MSYS2's runtime has auto-conversion functionality, trying to guess what arguments passed to a non-MSYS2 program may be Unix paths, converting them to Windows ones.

So what you may see here has nothing to do with MSYS2's Git *not* having the change that breaks Cygwin Git for you, but MSYS2's runtime saving you from trouble.

> Judging from the error-message, it somehow concatenates input & output
> paths.
> Isn't this something to research about?

It is something to research about. But by you, not by me. I need to focus on bigger-impact issues, because I do not scale, and Git for Windows' users generally do not experience the problem you described.

Ciao, Johannes

ankostis· May 16, 2017, 13:09 UTC · re: Johannes Schindelin · lore

Re: CYGWIN git cannot install python packages with pip

On 4 May 2017 at 13:26, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 10 quoted lines
> Hi,
>
> On Thu, 4 May 2017, ankostis wrote:
>
>> On 4 May 2017 at 11:47, Adam Dinwoodie <adam@dinwoodie.org> wrote:
>> Judging from the error-message, it somehow concatenates input & output
>> paths.
>> Isn't this something to research about?
>
> It is something to research about. But by you, not by me.
You got a point there.
> I need to focus
> on bigger-impact issues, because I do not scale, and Git for Windows'
> users generally do not experience the problem you described.

Git for Windows uses MINGW indeed. But there are still CYGWIN users out in the wild running the vanilla Windows python installation.

Actually this issue has a big impact on those of us because recent `setuptools` tools allow for packages to specify project dependencies using the `git+https://...` url-scheme. So the problem may appear to unaware users just trying to install a packages the regular way, with `pip install foo.package`

Great thanks,
  Kostis
FYI, cross-posting also to CYGWIN list.
ankostis· May 16, 2017, 13:15 UTC · re: ankostis · lore

Re: CYGWIN git cannot install python packages with pip

On 2 May 2017 at 20:08, ankostis <ankostis@gmail.com> wrote:
Show 21 quoted lines
> On Windows, with Cygwin-git 02.12.2-1 the python command:
>
>     pip install git+https://github.com/...`
>
> fails to work with the following error:
>
>     $ pip install git+https://github.com/ipython/traitlets/
>     Collecting git+https://github.com/ipython/traitlets/
>     Cloning https://github.com/ipython/traitlets/ to c:\users\username\appdata
> \local\temp\pip-kjwxq_oy-build
>     fatal: Invalid path '/cygdrive/d/Work/ALLINONES2/co2mpas_AIO-v1.6.0/CO2MPA
> S/C:\Users\username\AppData\Local\Temp\pip-kjwxq_oy-build': No such file or di
> rectory
>     git clone -q https://github.com/ipython/traitlets/ C:\Users\user\AppData\L
> ocal\Temp\pip-kjwxq_oy-build" failed with error code 128 in None
>
>
>
> Git-2.8.3 had no such problem.
>
> Any ideas?
Reporting for those bitten by this, latest working CYGWIN timemachine
release is on 16 March 2017:
  http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2017/04/16/142104/index.html

← back to recent threads