[英]no python at "C:\Users\AccountName\AppData\Local\Programs\Python\Python38-32\python.exe" error in VsCode
I was running the Django project without any problems.我正在运行 Django 项目,没有任何问题。 Until I reinstalled Windows and then reinstalled vscode, Now that I am running the Django project: vscode shows the following error:直到我重新安装了 Windows 然后重新安装了 vscode,现在我正在运行 Django 项目: vscode 显示以下错误:
Error: no python at C:\Users\AccountName\AppData\Local\Programs\Python\Python38-32\python.exe
This might be occurs if the python directory still in the environment variables path list.如果 python 目录仍在环境变量路径列表中,则可能会发生这种情况。
Based on the information you provided, it is recommended that you check the Python environment variables.根据您提供的信息,建议您检查 Python 环境变量。
Since the Windows system is reinstalled, the environment variables are restored to the default settings.由于重新安装了Windows系统,环境变量恢复为默认设置。 Therefore, please add Python environment variables:因此,请添加 Python 环境变量:
Or you can reinstall Python and check the "Add Python 3.8 to PATH " option, which will automatically add Python environment variables.或者您可以重新安装 Python 并选中“将 Python 3.8 添加到 PATH ”选项,这将自动添加 Python 环境变量。
You could also refer to : Python environment variables .您还可以参考: Python 环境变量。
It's very simple这很简单
pip install virtaualenv
安装虚拟环境pip install virtaualenv
and play with your code you shared .并使用您共享的代码。
This works for Pycharm, It did to me From your projects folder, delete the 3 folders ie .ide,venv, and the third folder i think.. do not touch the projects or scripts you created.这适用于 Pycharm,它对我有用 从您的项目文件夹中,删除 3 个文件夹,即 .ide、venv,以及我认为的第三个文件夹......不要触摸您创建的项目或脚本。 After wards, go to Pycharm and configure python interpreter again.之后,再次进入Pycharm并配置python解释器。 This will now enable you to run yo scripts now with no prob这将使您现在可以毫无问题地运行 yo 脚本
Edit pyvenv.cfg编辑 pyvenv.cfg
home = C:\Users\UserName\AppData\Local\Programs\Python\Python38-32
include-system-site-packages = false
version = 3.8.3
When I edited this file after checking the file path on my computer, it worked for me.当我在检查计算机上的文件路径后编辑此文件时,它对我有用。
确保在安装 python 之前安装 virtualenv
check wheather django is installed (if your are using django framework).检查是否安装了 django(如果您使用的是 django 框架)。
pip install django pip 安装 django
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.