[英]How to run python from the terminal if I installed it using Visual Studio?
I have installed python using Visual Studio, but I can't use python from the command prompt.我已经使用 Visual Studio 安装了 python,但是我无法在命令提示符下使用 python。 I also want to run python from the command prompt, but it is only accessible from Visual Studio.
我也想从命令提示符运行 python,但它只能从 Visual Studio 访问。 I have tried adding the path of the directory in which Visual Studio has installed python to the user environment variables, but typing python in the command prompt opens up Windows Store.
我尝试将 Visual Studio 安装 python 的目录的路径添加到用户环境变量中,但在命令提示符中键入 python 会打开 Windows 应用商店。 Please somebody help me with this.
请有人帮我解决这个问题。 Is there any way around or do I have to install python separately too.
有什么办法可以解决,或者我也必须单独安装python。
go to python.org and download the latest version of python (You can download it from the windows store too).转到python.org并下载最新版本的 python(您也可以从 Windows 商店下载)。 Then open a new terminal and write
python --version
.然后打开一个新终端并编写
python --version
。
NOTE: Don`t forget the open a new terminal.
step1 : install the python from python.org (dont forget to check the PATH installation radio button) step1:从python.org安装python(不要忘记检查PATH安装单选按钮)
step2: check the python from CMD with command :步骤2:使用命令从CMD检查python:
python --version
蟒蛇--版本
step3: go the project directory and run : step3:进入项目目录并运行:
python your_project_file_name.py
python your_project_file_name.py
thanks for replying.感谢回复。 I figured out the answer myself, and thought to answer it for anyone in the future who comes across the same issue.
我自己想出了答案,并想为将来遇到相同问题的任何人回答。
I went into settings->Apps我进入设置->应用程序
Find the python installation and click on it, select modify.找到python安装并点击它,选择修改。
Then click on "modify installation" when the python installation repair window opens, then again click on "modify", make sure to select "Add python to path", and also py launcher option also.然后在python安装修复窗口打开时单击“修改安装”,然后再次单击“修改”,确保选择“将python添加到路径”,还有py启动器选项。
That fixed the problem for me.那为我解决了问题。
Thanks, again.再次感谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.