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 CE94539AF1B7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=anrdaemon AT yandex DOT ru DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1612366502; bh=6gvwCkAyI/i1ZzeSbgs0rnfoY9FPfsx7K90/IK6OHpM=; h=In-Reply-To:Subject:To:From:Message-ID:References:Date:Reply-To; b=Ou4/xKKyaWwbNtq+y+BxaPKlkcPJeUpNdUgO5QXLaRhCpx1ZsavoxldIewr6hqoSe bKrh+vaUGhafJVOhwAdB3LnBKwrd7eZ1vTAYWqjQyXmoEORhsJ9018QMzYEpKIzlIa Db41d9wc0/+/4yBXxyK4hjUSUEZiBDlg5bEAOCYg= Authentication-Results: sas1-934f36a1872d.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Date: Wed, 3 Feb 2021 18:27:48 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home X-Priority: 3 (Normal) Message-ID: <399245376.20210203182748@yandex.ru> To: "Lemke, Michael SF/HZA-ZIC2" , cygwin AT cygwin DOT com Subject: Re: python sys.executable inconsistency if called from cmd In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" Greetings, Lemke, Michael SF/HZA-ZIC2! > I don't know anything about python but want to use cygwin's > python from nodejs with npm-gyp. The npm-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. > 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. > Is there a way around to make this work? Yes, write scripts correctly, correctly translate paths. See: > FAQ: https://cygwin.com/faq/ > Documentation: https://cygwin.com/docs.html Specifically see `man cygpath`. -- With best regards, Andrey Repin Wednesday, February 3, 2021 18:25:18 Sorry for my terrible english... -- 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