delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/02/03/11:18:56

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B6920386185F
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
header.from=schaeffler.com
Authentication-Results: sourceware.org;
spf=pass smtp.mailfrom=lemkemch AT schaeffler DOT com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=T8i8NEC2/N+AuZMx6+cQitRLtQZEO9EJkaZ424fKxGZCjO7qfkUgXRzGqaZRqjc4aTxxW6e8OwJGwBO8CLpQU5tpzlhBvz+6lhwEKubZUwofEpsE/nOt6I43ZYaok43G+44rlfZH5TdK+3QkWOT9DhcOExR0YeZjoo5/yQT7LvQQ7JDWEXeAPN6ILtBgLM6WUn09OWlX3KhaTZiyxw7cKyVVyCHhsi/Vax3EASbOYKQoOfBOV6/o8xa4B1K7Z8T5bNlLdlTc6RdLnQXjPHbUJRtUqjPaR8AbMtrTO72lY2qw91fzx0bTJ+KvfniAeHKVTOyk5Nzb1U45I24gCTMbvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=rIJqLUWFpBTQUa0I27Z+pALkNPkZRuj+gOPdx3V+CXM=;
b=QqFuTs76on1cGdL+BNRWorlgwmWekFXoXFv2LwLzWCOX29q2RtYaT8UJpUfN6ralihag14yYR7I/MaIYWia+nfzL1WsrIfBNCuiw9m90c712ukX1ueCfkEXza6KFbobSW+uG/s+/e1WzJ9e1F7bDqSJnMP7Ugzqy1sHlllyMNEAY0Ok8mX+VstgrqnJPJT9d6O2nvrYFPpAcZhzwlTN+T4ry/7CCRKzYYVpeWUniVSWp2Sd+EQ0KS5vWWMq0yWWoLvG7FW6wJ+RguBhiKoijO1vbQ2KfehSHqM1Hchf866Wifif3MpViEFe+Fw/mxB1tjRQCZdeMHA6XJQLK36CnzQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=schaeffler.com; dmarc=pass action=none
header.from=schaeffler.com; dkim=pass header.d=schaeffler.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=worksite.onmicrosoft.com; s=selector2-worksite-onmicrosoft-com;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=rIJqLUWFpBTQUa0I27Z+pALkNPkZRuj+gOPdx3V+CXM=;
b=TRQpzCK3JVs/KiyV454VdJ2mJuTy8ZvF8LubVuXHQFswYgELAO/CLKV9AexGvw4dF5X5xOIIu8jwISHwSX+hosZNlgsb1tpSh0l8IQqIaJxi9j+gtes7yY2aNDeAKzPOH4l3j3iHtC+5qS4fBm+sVYwbdpk0/qjKm2q1kBYzIlE=
From: "Lemke, Michael SF/HZA-ZIC2" <lemkemch AT schaeffler DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: python sys.executable inconsistency if called from cmd
Thread-Topic: python sys.executable inconsistency if called from cmd
Thread-Index: Adb6OAV0nj0f++LjRdqSUpkvUq02ZgACRsYAAAE5uAA=
Date: Wed, 3 Feb 2021 16:17:41 +0000
Message-ID: <VI1PR03MB64465B94BA262E27B051920DBEB49@VI1PR03MB6446.eurprd03.prod.outlook.com>
References: <VI1PR03MB644670814A7A43C6934EBC93BEB49 AT VI1PR03MB6446 DOT eurprd03 DOT prod DOT outlook DOT com>
<399245376 DOT 20210203182748 AT yandex DOT ru>
In-Reply-To: <399245376.20210203182748@yandex.ru>
Accept-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: cygwin.com; dkim=none (message not signed)
header.d=none;cygwin.com; dmarc=none action=none header.from=schaeffler.com;
x-originating-ip: [199.247.40.39]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 4f3500ff-ae4e-4d84-2790-08d8c85f3b0f
x-ms-traffictypediagnostic: VI1PR03MB5024:
x-microsoft-antispam-prvs: <VI1PR03MB502440277634A9835CE4144DBEB49 AT VI1PR03MB5024 DOT eurprd03 DOT prod DOT outlook DOT com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: HHkGFcLKNBhSajv+dmyfGd7HxSfsqTuBb2tWDgQQTqKBcVLE+DKTRlj4CZlY7bA4Egq9JkPnryCSnDsQBKVf34fX2ydOIHK7t73BdWpbW7/bma3WxgEVw8w4MgosAkvAvwu67ViaHaZoMvI62RWwRN1LxjBSinIplW15L7R0vZvKO15k0Y79xgCZO0R8f86SNKADYpUeod70arHXfORr5eU8hP5ofT4m6DuP3sQGaMANTZtSsxMXJKhZ4q27seEG8CCDsz0HXXm6zo98dTNvT7cBEKM1K/5D95mE7tBWnsVS9JR19K1yeHePNL9WL2K+wLW3fyz1pxqQHoqWI/xT8AC/bA77Bhy80/YscMo4KvWGMd4cf/Oh6AuMYVsfSGHd3bngD0dPNioeL8QMOomElgp1VpJSdPZWvu1E8gWyXCT7g1OIOc2qL+h4Xrsgw6AbHxAnKxl6bjg92B6r4fOXfKcQ7DIRYnxH2hgNfzJRj2aPJrDqzwTKnLzXsBA5wNm2yxstfFmRPe6xex0zYi71DxSzO+3pkirBzgtXZf8dGm0u3YNjMTsl0yYZjMd6Md5ufEwg+kGP0A6FlR6rebdM1tyJ/07lY2bGsPOPLonY+eE=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:VI1PR03MB6446.eurprd03.prod.outlook.com; PTR:; CAT:NONE;
SFS:(4636009)(136003)(376002)(366004)(346002)(39860400002)(396003)(8936002)(76116006)(8676002)(5660300002)(33656002)(64756008)(66476007)(66446008)(66556008)(478600001)(2906002)(7696005)(6506007)(26005)(186003)(53546011)(71200400001)(86362001)(316002)(66946007)(55016002)(9686003)(52536014)(6916009)(460985005)(2480315003);
DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata: =?utf-8?B?aWJPK0IvUWVzUkVKRnJHak5McFRzSGo5TnhacWluWmV1ckRXd3NVQklaUC96?=
=?utf-8?B?eGlQSGZvQW9LVFFzWU03NUM1QUVaeXZobmRJQ01GZVBFYmUwSnM5ZC9ab3Qw?=
=?utf-8?B?TXNFTWtTWGFXZjBWY3RXRHhrcjVJN2dXOGZPN2Q4VUs0RjVPL21YUDV5V2xC?=
=?utf-8?B?SkhFbWdiR1JBNzBvdk5OUFlmcXRSWHJzR2ZhVVdVSDZRU3V2YUl5ejR0U3pO?=
=?utf-8?B?K2hURDN1bk9kWVppTlVnKzM4dGFRTGF5TG05Yml4ODUxWmJpMXA4cVJuUTNB?=
=?utf-8?B?NDNXZVZ2QmFmQnk2c2tEV2FOWi9VYUo4Zkl5QytwdkJzNGxjcWNwV2w0Tlhp?=
=?utf-8?B?aEQwOU9MOEhzUFdoOURacmNoSXl5RUhOSFdiT1Ura2VJeVh4QlQzc0ViZHgw?=
=?utf-8?B?MWRrZFBEdWJYYVNQUUFxMGR0Z1UvWTYwL2VWamViV2VtZEVDUEVqQjZtcEhO?=
=?utf-8?B?NWlJODJ0MXk4RFVFcU9RSUU2RWsvczZtZUdxb3JlNXRuR0cvRE4vRmswNmh3?=
=?utf-8?B?ZXJpd014WFZFS29UeDlXbWE3TC9raGdiRGxpM3BDMloybFJDRGNHblFDVEg0?=
=?utf-8?B?OE1NdXZlZlZhM0ZBb0cwSTVzZXY2VW9oSzEzUG5uc29rU2VpRUhZYitoS3Bh?=
=?utf-8?B?YUVtWnVKa216UWVQNmE2NFdndG1ZOHhDd0RaVUd0TTRLOGJVVG1CcWVta3J1?=
=?utf-8?B?MnZBRmNUQmtVNzVxRy91RGZLaEcxS3RTek5QQStBYnRDMXV3SWZw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ZqSEtUZ01WQVBZVWlITmJrMXdQSDZDWlkrUWFyUmxuZ2pVd1pSeXlX?=
=?utf-8?B?eS9IWVpJTnJEbUF6YzhOcGxHMVJ5YVJDcGhQTHkxNDZjaDhOYjEvT2JWbUhU?=
=?utf-8?Q?ckP+tzTNIvZ2wjMCV2K1IhJ1FTmQjxAY5BGIMVR?=
x-ms-exchange-transport-forked: True
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB6446.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4f3500ff-ae4e-4d84-2790-08d8c85f3b0f
X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2021 16:17:41.0585 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 67416604-6509-4014-9859-45e709f53d3f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 1l/jXX1X1t5NU7nPeB27ZsLbavUfX/XZCOTOkPwCVI0JoSbLpUz0Ht4yc1QSRRY7LB1KDCeR1ng8+cayZN25bg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB5024
X-OriginatorOrg: schaeffler.com
X-MailControlDKIMCheck: cGFzcyB3b3Jrc2l0ZS5vbm1pY3Jvc29mdC5jb20gW3Bhc3Nd
X-MailControl-OutInfo: MTYxMjM2OTA3MjpGUEtleTEucHJpdjoXoJL6IkLMEfTxeXBN0RIMnROubkLWTGZ0IHPeRL5JaYNzekIWyPLZdfGj1D0o+oyFOZopkENm5fuI3n4dJcptJgVEY6TholDGc13UKb9bvIsnfiW2aQK3oYgio9gU4G0cUkedIHCQyXPYxRFuF0f5lx7gLygVT6vBgmC8++7zaBgD0OEUQOdQzhs0dTQvv2mBeaumvg56SkZAEIyfw3a99r+K4lNMrQDgg0c45gf20wYUQP28rhq3Ju+YGvwPMJmR/RqR8o4SjejnZjhCJXuo2c/Psu2/APs8GvFJNpWagIPVY6SF+eXNffZuIusP8l2JRBV30ut/gEyB+/qbWgEt
X-Scanned-By: MailControl 44278.2100 (www.mailcontrol.com) on 10.68.0.120
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,
SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

On Wednesday, February 3, 2021 4:28 PM Andrey Repin wrote:
>Greetings, Lemke, Michael  SF/HZA-ZIC2!
>
>> I don't know anything about python but want to use cygwin's
>> python from nodejs npm with node-gyp. The node-gyp module is trying to
>> find the python executable path from sys.executable and fails.
>
>If that's true, then it should be fixed upstream.

Good to know but I doubt that they will. For those who need this -
here is a workaround for node-gyp v5.1.0 I just found:

cygwin> mkdir /c/Python37
cygwin> ln `which python3.6m` /c/Python37/python.exe

I aware of the version clash here but c:\Python37 is one of a
few explicit locations this node-gyp looks at. Doesn't seem
confused if the versions don't match. The file you link to 
must be the actual Cygwin executable not any of the python 
links in /bin.

>
>> While investigating this I found this to me quite inconsistent
>> behavior:
>
>> cygwin> /bin/python3.6m.exe -c 'import sys; print(sys.executable);'
>> /bin/python3.6m
>
>> cygwin> python3.6m -c 'import sys; print(sys.executable);'
>> /usr/bin/python3.6m
>
>> cygwin> python3.6 -c 'import sys; print(sys.executable);'
>> /usr/bin/python3.6
>
>> cygwin> python3.6m.exe -c 'import sys; print(sys.executable);'
>> /usr/bin/python3.6m
>
>
>> cmd> c:/MyStuff/NCygwin64/bin/python3.6m.exe -c 'import sys; print(sys.executable);'
>> /usr/bin/python3.6m
>
>> cmd> rem add cygwin path to Windows:
>> cmd> path %PATH%;c:\MYSTUFF\ncygwin64\bin
>
>> cmd> python3.6m.exe -c 'import sys; print(sys.executable);'
>> /c/MYSTUFF/ncygwin64/bin/python3.6m
>
>> With CMD I'll never get an executable that actually works from cmd.
>> Is this expected?
>
>Yes. This is Cygwin, not Windows CMD.

Sure but python seems to start just fine under cmd and it does do
some gyrations with sys.executable dependent on calling environment.
So this looks somewhat fishy to me.

>
>> Is there a way around to make this work?
>
>Yes, write scripts correctly, correctly translate paths.

See above.
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019