简体   繁体   English

如何使Python 3.9运行命令提示符windows 10?

[英]How to make Python 3.9 run command prompt windows 10?

"python --version Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases." “python --version Python 未找到;在没有 arguments 的情况下运行以从 Microsoft Store 安装,或从设置 > 管理应用程序执行别名禁用此快捷方式。”

This is what I get trying to make sure it works (clearly it doesn't).这就是我试图确保它工作的原因(显然它没有)。 I'm quite a rookie with all this.我对这一切还是个新手。 I started cause I wanted to run some script on bluestacks, so I needed Python and ADB added both PATH.我开始是因为我想在 bluestacks 上运行一些脚本,所以我需要 Python 并且 ADB 添加了两个 PATH。 The problem comes here.... It is indeed added to Path:问题来了....确实添加到Path中:

C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Users\Sierra\AppData\Local\Microsoft\WindowsApps;C:\platform-tools;C:\Users\Sierra\AppData\Local\Programs\Python\Python39;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\Lib;

This is PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC这是PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

This is PYTHONPATH (I made it since I saw someone saying it would fix it):这是 PYTHONPATH(我做了它,因为我看到有人说它会修复它):

C:\Users\Sierra\AppData\Local\Programs\Python\Python39;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\Lib;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\include;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\DLLS;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\Sierra\AppData\Local\Programs\Python\Python39\Lib\site-packages

Weird enough the fact that ADB works fine:奇怪的是亚行工作正常:

C:\Users\Sierra>adb --version Android Debug Bridge version 1.0.41 Version 30.0.5-6877874 Installed as C:\platform-tools\adb.exe

Since I did the same in both cases, I can't get why it's not working.因为我在这两种情况下都做了同样的事情,所以我不明白为什么它不起作用。 Maybe I did something wrong with the Python version I downloaded?也许我下载的Python版本有问题? Weird thing too, since I also have stilled version 3.8也很奇怪,因为我也有静止的 3.8 版

Also, the script I need says "Python 3.7.X installed and added to PATH."另外,我需要的脚本说“Python 3.7.X 已安装并添加到 PATH”。 I guessed 3.9 would work, since it's the newest我猜 3.9 会起作用,因为它是最新的

I apoloogize cause my English.我很抱歉,因为我的英语。 I'm not native speaker, so I could have messed up somewhere.我不是母语人士,所以我可能在某个地方搞砸了。 Many thanks,!非常感谢,! Forgot to tell, I use Windows 10忘了说,我用的是 Windows 10

When you run the setup exe for python a list of tiny boxes should pop up and one will say add PATH to python?当您运行 python 的安装程序 exe 时,应该会弹出一个小框列表,其中会显示将 PATH 添加到 python? If you click yes it will add PATH to python which seems like your issue I think?如果您单击是,它会将 PATH 添加到 python 我认为这似乎是您的问题? If you have multiple versions of python installed that could cause a issue type python in cmd if it has a error then you didn't install python properly.如果您安装了 python 的多个版本,这可能会导致 cmd 中出现问题类型 python 如果它有错误,那么您没有正确安装 Z23EEEB4347BDD755B755DDZ6。 Double check you have all the required modules installed if that doesn't work then I'm lost.仔细检查您是否安装了所有必需的模块,如果这不起作用,那么我迷路了。 Anyways here's the code to open cmd.无论如何,这是打开 cmd 的代码。

import os导入操作系统

os.system("cmd") os.system("cmd")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在命令提示符Windows 10中运行python脚本 - How to run python script in Command Prompt Windows 10 如何在 Windows 命令提示符下运行 python 文件? - How to run a python file in the windows command prompt? 如何在我的 windows 命令提示符上设置 python 3.9? 它显示错误 python not found - How to setup python 3.9 on my windows command prompt? It shows an error python not found 如何在 Windows 10 中为 python 3.9 安装 pygame? - How to install pygame in Windows 10 for python 3.9? 如何在Windows 10中从常规命令提示符处激活python anaconda并运行脚本 - How do I activate python anaconda and run script from regular command prompt in Windows 10 无法通过Windows命令提示符运行简单的Python程序 - Cant make simple Python program run through Windows command prompt Python 3.9中如何通过命令行运行程序 - How to run the program by command line in Python 3.9 如何从Windows命令提示符运行远程Python程序 - How to run a remote Python program from Windows command prompt 如何在 Windows 7 的命令提示符中运行 Python 程序? - How do I run a Python program in the Command Prompt in Windows 7? 如何在Windows 10中的命令提示符(cmd)中从带有子进程模块的python脚本编写命令 - how to write command in command prompt (cmd) in windows 10 from python script with subprocess module
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM