delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/07/03/20:05:43

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58AD1385781F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1688429097;
bh=3WzFvLCCqrm4sPybkGQVV68NsmQP2PWEYMIYNKku/Uo=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=AKtg0fL81q9ys8uQl6zt0xpRyH5GLQMXJn+Ev8RxSjwAyRTZrddoG7aV9mqCFjtge
qC7f8Vw/1cSyUTxnXSC5DapqRyUlGOV5I+e7VFoRdJoAWjPv4fcOHRQl8Y6Fe5Qn9w
BDBk6kG+eF7RgrxeppP0wgQJ3ChNN4AhxgUblXIk=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6DF2F3858436
X-Authority-Analysis: v=2.4 cv=XZqaca15 c=1 sm=1 tr=0 ts=64a36216
a=DxHlV3/gbUaP7LOF0QAmaA==:117 a=DxHlV3/gbUaP7LOF0QAmaA==:17
a=IkcTkHD0fZMA:10 a=FnYuCCsDFmQTfREySvoA:9 a=QEXdDO2ut3YA:10
Message-ID: <9ed03ff4-2130-7502-cad2-55a8601eea39@Shaw.ca>
Date: Mon, 3 Jul 2023 18:04:37 -0600
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Subject: Re: Conda Python script not getting right command line argument
To: cygwin AT cygwin DOT com
References: <CAHvsuxkDWyCrLkcATSdJv2D+y=yLAWr9T2-eLAnO20jVWysiuw AT mail DOT gmail DOT com>
Organization: Inglis
In-Reply-To: <CAHvsuxkDWyCrLkcATSdJv2D+y=yLAWr9T2-eLAnO20jVWysiuw@mail.gmail.com>
X-CMAE-Envelope: MS4xfLjAZKafVA/3Xa96NsgPxSobDJ/l1jnSsG2lb8tRtNVxzC3fJD7FCHs2A9n0/fJIVN85lbLgT/UHOm7gSngp9XbdOShARdPViACl+0L+jZ8cljcZQy53
cTPRkKmeSjHFDBp5eFrtxn6jSUcnRi7/Z/0KWIJa5wmaCGycgHtVlF6c4XQZs9CZUdjkflPnNJLQKCDbKf7yD5t5Ijv9Jbm4RD0E9DHemMrydTZyNUif8pTI
X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW,
RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
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>
From: Brian Inglis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Brian Inglis <Brian DOT Inglis AT Shaw DOT ca>, ravi r <ravi480000 AT gmail DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 36405LTf014923

On 2023-07-03 16:12, ravi r via Cygwin wrote:
> Using
> Cygwin Python interpreter invoked from shebang line
>      $ cat /tmp/script1
>      #!/usr/bin/python
>      print("hello");
>     $ /tmp/script1
>      hello
>      $
> works as expected.
> Conda Python interpreter invoked from shebang line
>      $ cat /tmp/script2
>      #!/usr/local/anaconda3/python
>      print("hello");
>      $ /tmp/script2
>      C:\cygwin64\usr\local\anaconda3\python.exe: can't open file
> 'C:\\tmp\\script2':
>      [Errno 2] No such file or directory
>      $
> fails to get the right path of the input file to execute. The correct
> path that should been
> passed to the Conda interpreter would have been
>      c:\cygwin64\tmp\script2
> Version of cygwin being used
>      base-cygwin                                         3.8-2

Package base-cygwin has its own version and only helps setup the first install.

Cygwin version can be shown by running uname -a or head /proc/version.

Cygwin supports running scripts using Cygwin paths with Cygwin interpreters.
Cygwin executes Windows executables directly, and does not convert Cygwin paths 
into Windows paths: you have to set the paths up to make them correspond, or 
provide an appropriate argument for a Windows executable.

As Anaconda is a commercial Windows product, you have to change those python 
scripts to use Windows paths acceptable to that product, run from a Windows 
shell, using Windows Open with... file associations.
Anaconda product support can help you with setup and changes needed.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

-- 
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