Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.lang.python / How to fix Python error, The term '.../python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program, in VS Code?

SubjectAuthor
* How to fix Python error, The term '.../python.exe' is notLouisAden Capellupo
`- Re: How to fix Python error, The term '.../python.exe' is not recognized as the Dennis Lee Bieber

1
How to fix Python error, The term '.../python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program, in VS Code?

<mailman.665.1665533135.20444.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19819&group=comp.lang.python#19819

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: louisade...@yahoo.com (LouisAden Capellupo)
Newsgroups: comp.lang.python
Subject: How to fix Python error, The term '.../python.exe' is not
recognized as the name of a cmdlet, function, script file, or operable
program, in VS Code?
Date: Tue, 11 Oct 2022 16:40:31 -0700
Lines: 71
Message-ID: <mailman.665.1665533135.20444.python-list@python.org>
References: <998337851.644732.1665531633363@yahoo.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de vNlhCFFksVFg5mLjCSsXAgkLlZwyGSr5/UScBZ2ii0JA==
Return-Path: <louisadencap@yahoo.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=yahoo.com header.i=@yahoo.com header.b=TgtxfiZ2;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.009
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'message:': 0.03;
'python.org.': 0.05; 'subject:error': 0.07; 'subject:name': 0.07;
'python.': 0.08; '8bit%:3': 0.09; 'included,': 0.09; 'line:':
0.09; 'subject:Code': 0.09; 'subject:not': 0.09; 'subject:script':
0.09; 'terminal': 0.09; 'url-ip:13.107.213.67/32': 0.09; 'url-
ip:13.107.213/24': 0.09; 'url-ip:13.107.246.67/32': 0.09; 'url-
ip:13.107.246/24': 0.09; 'subject:Python': 0.12; 'downloaded':
0.13; '3."': 0.16; 'extensions': 0.16; 'paths': 0.16; 'runner':
0.16; 'runner?': 0.16; 'script,': 0.16; 'subject:program': 0.16;
'problem': 0.16; 'python': 0.16; 'code.': 0.17; 'to:addr:python-
list': 0.20; "i've": 0.22; 'subject:file': 0.22; 'code': 0.23;
'command': 0.23; 'installed': 0.23; 'laptop': 0.23; 'subject:How':
0.23; 'run': 0.23; 'to:name:python-list@python.org': 0.24;
'clicked': 0.26; 'jun': 0.26; 'normally': 0.26; 'visual': 0.26;
'greatly': 0.28; 'output': 0.28; 'error': 0.29; 'code,': 0.31;
"doesn't": 0.32; 'but': 0.32; "i'm": 0.33; 'path': 0.33; 'script':
0.33; 'windows': 0.34; 'appreciated.': 0.34; 'work.': 0.34;
'running': 0.34; '"the': 0.35; 'received:66': 0.35; 'thanks,':
0.36; "skip:' 10": 0.37; 'using': 0.37; 'directory': 0.37;
'this.': 0.37; 'url-ip:13.107/16': 0.38; 'file': 0.38; 'way':
0.38; 'two': 0.39; 'url:550986': 0.39; 'url:fwlink': 0.39;
'url:linkid': 0.39; 'quite': 0.39; 'necessary': 0.39; 'url-
ip:23.66/16': 0.39; 'received:66.163': 0.39;
'received:consmr.mail.ne1.yahoo.com': 0.39; 'use': 0.39; 'prompt':
0.39; 'message-id:@yahoo.com': 0.40; 'program.': 0.40; 'studio':
0.40; 'hello,': 0.40; 'want': 0.40; 'try': 0.40; 'sorry': 0.60;
'included': 0.61; 'skip:o 10': 0.61; 'verify': 0.64; 'skip:o 40':
0.64; 'verified': 0.64; '&amp;': 0.65; 'worked': 0.67; 'fixing':
0.69; 'it:': 0.69; 'showed': 0.69; 'subject:The': 0.70; 'name,':
0.75; 'recognized': 0.75; 'skip:c 70': 0.75; 'skip:f 20': 0.75;
'rights': 0.76; '(c)': 0.81; 'reserved.': 0.81; 'click': 0.83;
'copyright': 0.84; 'han': 0.84; 'skip:& 50': 0.84; "skip:' 70":
0.84; 'spelling': 0.84; 'subject: \n ': 0.84;
'\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0': 0.84; 'skip:d 30': 0.86
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1665531633; bh=e3Ri0OVj1CmiMs3agH370XXCYau7iffxEu0frl5ASyY=;
h=To:From:Subject:Date:From:Subject:Reply-To;
b=TgtxfiZ2Pe8IP4orUODaT7OXbGuD6Xhpb8r7Ga/gCGXoF3WLuWnbkm7l6qU7XD45ArFLVIOibIp1fR/WKYhLlP84A+RTmSsdg3JfGM7ueDLkYkhAurqhlP9EKGsK4paGu1gk48t0GdIqQf2lBvHhUqF5IKGS1YFb0vw/1FZqQ6qnCXh9RH+mrZQaXX3YhDwSa+5rAgxXUQ1F+ZjZ4Yu8sySSQkYbEb+PstP8YjN3UAHQAwmq+NrTQB8MTDbQeJ9JuGMvzpaXaTa8Y2lJNx1E+g9DeE02uiLe2kC88Y7PsChQqTHvJ9aX79XJyH2mbqvc4vMBIJjVB/Rt5NNdMi/nlQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1665531633; bh=RF1B6tDYFI9FkfVEkbMTjuOsqB6sNWXGQ15LymEu2OX=;
h=X-Sonic-MF:To:From:Subject:Date:From:Subject;
b=QylAky/5/r55hTvaZv+F+SIzvZt47hlv0LgYykUA/NnLfod/TE8R8UmkdRDrBLzZC5W3RIkSxeX/SXbrLB+4Vwj5bhLm9gm2GUvtsdzQz/vVbTZ7gtetTi8c9fBlt4v84ZiYHYk+APqARyCCbj5dsTJR9koWz65VQVaWTUelaDn4nUnZQT7em3hvqVvp++TgHm//FQWm5c7MLl4mbZ9O8MQW29L2xYaxY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O7nEJEzFMkLgMko6TSdBJR2e1LZMwdqssot75
9YBNwgI21uoAmppEH3h4v6SHfi78723G_PkiYx_7i8FqRcwvte7gNy378yyyZNvMDWlUwcumlQzG
qju6tWBPjkUnipDQofnA0XBSyN1JMlrk5Kseh6w4bgKm.iF52P0Hz6eWsT0pzAZd7XeUf0G2EZWs
mGgI9_OwqIueOiVlBvn5Sg9Ap646eb9dawFgl63k9eAqNBQcNzMUB33r5KMWRAYCj8uQwiQT4Z9A
QaBFokiEn4V5TP14-
X-Sonic-MF: <louisadencap@yahoo.com>
Importance: normal
X-Priority: 3
X-Mailer: WebService/1.1.20740
mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
X-Mailman-Approved-At: Tue, 11 Oct 2022 20:05:34 -0400
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <998337851.644732.1665531633363@yahoo.com>
 by: LouisAden Capellupo - Tue, 11 Oct 2022 23:40 UTC

     Hi! I've just downloaded and installed Python 3.10..7 (64-bit) for Windows 10 from python.org. I'm quite new but, I've already downloaded and installed Visual Studio Code as well. I have included the two paths for python under User Variables. C:\Users\It'sMeLil'Loui\AppData\Local\Programs\Python\Python310\Scripts\, and C:\Users\It'sMeLil'Loui\AppData\Local\Programs\Python\Python310\. I verified that python is recognized in the Command Prompt and PowerShell and installed the necessary extensions for python in Visual Studio Code. I created a test python file in the directory of D:\Projects\Python\Test\HelloWorld.py, and opened it in Visual Studio Code. I also restarted my laptop after all of this. Under the arrow used to run the code, I clicked "Run Code" (since I have Code Runner by Jun Han installed), and it worked just fine, displaying the output in the terminal.

Code:

print("Hello, world.")
input("Press Enter to continue...")

Output in Terminal when using Code Runner:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS D:\Projects\Python\Test> python -u "d:\Projects\Python\Test\HelloWorld.py"
Hello, world.
Press Enter to continue...
PS D:\Projects\Python\Test>
However, under the arrow to run code, when I click "Run Python File", I get this error message:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Output in Terminal when normally running it:

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS D:\Projects\Python\Test> & C:/Users/It'sMeLil'Loui/AppData/Local/Programs/Python/Python310/python.exe d:/Projects/Python/Test/HelloWorld.py
& : The term 'C:/Users/ItsMeLilLoui/AppData/Local/Programs/Python/Python310/python.exe' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ & C:/Users/It'sMeLil'Loui/AppData/Local/Programs/Python/Python310/pyt ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:/Users/ItsMeL...n310/python.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS D:\Projects\Python\Test>

     So basically, I get, "The term '...\python.exe' is not recognized as the name of a cmdlet, function, script, file, or operable program... At line: 1 char: 3." It works the first way I showed with Code Runner, but the second or original way doesn't work. What if I don't want to use Code Runner? Any help in fixing this problem would be greatly appreciated. Sorry if certain things are unclear as this is my first time using Python.

Thanks,
LouisAden

Sent from Mail for Windows

Re: How to fix Python error, The term '.../python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program, in VS Code?

<fopdkhh7p7qvvhcmqqtjcpn9luher85v94@4ax.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19840&group=comp.lang.python#19840

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!69.80.99.26.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 12 Oct 2022 16:12:17 +0000
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.python
Subject: Re: How to fix Python error, The term '.../python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program, in VS Code?
Date: Wed, 12 Oct 2022 12:12:18 -0400
Organization: IISS Elusive Unicorn
Message-ID: <fopdkhh7p7qvvhcmqqtjcpn9luher85v94@4ax.com>
References: <998337851.644732.1665531633363@yahoo.com> <mailman.665.1665533135.20444.python-list@python.org>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Lines: 15
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-gcuX6msM+7hf4XsxZMq1nwmUwM4dvtsxrdgpSRFIDJL8DLV2OztKDudFMBUINkkl/GNklJqe9Vx9xhw!zgjwCa47nAZQ2ax2RSPVz3FghDztcNc2aH5Uws7dyGnMOKrVLK5Umc+MGzXq5oY2fDw5UTzv
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 2207
 by: Dennis Lee Bieber - Wed, 12 Oct 2022 16:12 UTC

On Tue, 11 Oct 2022 16:40:31 -0700, LouisAden Capellupo
<louisadencap@yahoo.com> declaimed the following:

>     So basically, I get, "The term '...\python.exe' is not recognized as the name of a cmdlet, function, script, file, or operable program... At line: 1 char: 3." It works the first way I showed with Code Runner, but the second or original way doesn't work. What if I don't want to use Code Runner? Any help in fixing this problem would be greatly appreciated. Sorry if certain things are unclear as this is my first time using Python.
>

What happens if you change the system to use the "command" shell
INSTEAD OF PowerShell?

PowerShell may not honor the same environment variables.

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor