python无法在VS Code上加载 [英] python can't load on VS Code

查看:62
本文介绍了python无法在VS Code上加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Djangon/Python中进行开发,并一直使用Sublime Text.我想谈一个更完整的想法(控制台,调试等)所以我安装了VS Code,但是当我打开Django/Python项目时,当我想安装python扩展名时却出现了以下错误,但是却出现了以下错误:

I develop in Djangon / Python recently and use until now Sublime Text. I would like to go to a more complete idea (console, debug, etc ...) so I installed VS Code but when I open a project Django / Python I have the error below when I wanted to install the python extension but I had the error below:

环境变量路径"似乎具有一些包含"的路径特点.已知存在此字符已导致无法加载Python扩展.如果扩展程序无法加载,请修改您的路径以删除此"字符.

The environment variable 'Path' seems to have some paths containing the '"' character. The existence of such a character is known to have caused the Python extension to not load. If the extension fails to load please modify your paths to remove this '"' character.

当我查看PATH环境变量时,看不到引号,而是两行:

when I look at the PATH environment variable I do not see quotes but 2 lines:

%USERPROFILE%\ AppData \ Local \ Microsoft \ WindowsApps; C:\ Program Files \ PostgreSQL \ 11 \ bin; C:\ Program Files \ PostgreSQL \ 11 \ lib; C:\ Program Files \ Sublime Text 3; C:\ Users \ jl3.PRT-063 \ AppData \ Local \ Programs \ Python \ Python37-32 \ Scripts;

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\PostgreSQL\11\bin;C:\Program Files\PostgreSQL\11\lib;C:\Program Files\Sublime Text 3;C:\Users\jl3.PRT-063\AppData\Local\Programs\Python\Python37-32\Scripts;

C:\ Users \ jl3.PRT-063 \ AppData \ Local \ Programs \ Microsoft VS Code \ bin

C:\Users\jl3.PRT-063\AppData\Local\Programs\Microsoft VS Code\bin

我决定遵循VS Code Python教程,实际上,当我运行程序"Hello world!"时,我收到以下错误消息:

I decided to followed the tutorial VS Code Python and actually when I run the program "Hello world!" I have the error message below:

[正在运行] python -u"c:\ Users \ jl3.PRT-063 \ hello \ hello.py"python是否无法将'python'识别为内部或外部命令可操作程序或批处理文件?

[Running] python -u "c:\Users\jl3.PRT-063\hello\hello.py" 'python' Is not recognized as an internal or external command operable program or batch file in Python?

当我在Windows控制台上运行django项目时,我使用py而不是python ...我不知道为什么,并且是由我来设置VS Code的是使用python ...也许是问题的根源

When I run my django project with windows console, I use py instead of python... I don't know why and if it is me that set this VS Code use python... maybe it is the origin of the problem

有人可以帮我吗?

推荐答案

您实际上是在使用Code Runner执行代码,而不是使用Python扩展名(您可以通过 [Running] 位来分辨).如果您希望Python扩展程序执行该操作,请为您的Python工作区禁用Code Runner或将其卸载.

You are actually executing code using Code Runner, not the Python extension (you can tell by the [Running] bit). If you would like the Python extension to do the execution then either disable Code Runner for your Python workspace or uninstall it.

这篇关于python无法在VS Code上加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆