简体   繁体   English

尝试在 pycharm 上运行代码以及在 cmd 中输入 pip 时出错

[英]error when trying to run a code at pycharm and when typing pip at the cmd

I want to start with web development with python, django, react, javascript and when I download node.js at the windows PowerShell it showed me that its downloading python again and now when I want to run a code at PyCharm it is showing me this error:我想开始使用 python、django、react、javascript 进行 Web 开发,当我在 Windows PowerShell 上下载 node.js 时,它向我显示它再次下载了 python,现在当我想在 PyCharm 上运行代码时,它向我展示了这个错误:

Error running 'some new sobject': Cannot run program "C:\\Users####\\AppData\\Local\\Programs\\Python\\Python39\\python.exe" (in directory ""): CreateProcess error=2, The system cannot find the file specified Error running 'some new sobject': Cannot run program "C:\\Users####\\AppData\\Local\\Programs\\Python\\Python39\\python.exe" (in directory ""): CreateProcess error=2, The system cannot run找到指定的文件

or when I'm typing pip at the cmd it is showing me this error:或者当我在 cmd 中输入 pip 时,它向我显示了这个错误:

Fatal error in launcher: Unable to create process using '"c:\\users????\\appdata\\local\\programs\\python\\python39\\python.exe" "C:\\Users????\\AppData\\Local\\Programs\\Python\\Python39\\Scripts\\pip.exe" ': The system cannot find the file specified.启动器中的致命错误:无法使用 '"c:\\users????\\appdata\\local\\programs\\python\\python39\\python.exe" "C:\\Users????\\AppData\\Local\\Programs 创建进程\\Python\\Python39\\Scripts\\pip.exe" ': 系统找不到指定的文件。

I searched for some answers and nothing works should I redownload python?我搜索了一些答案,但没有任何效果,我应该重新下载 python 吗?

as @Ruli said, it can be due to some special character in the File Name or a Folder, or it can be anything.正如@Ruli 所说,这可能是由于文件名或文件夹中的某些特殊字符所致,也可能是任何内容。

My suggestion is to move that whole folder that is default created by PyCharm, and move it somewhere like C:\\ , so it is easier to locate the file and run it.我的建议是移动 PyCharm 默认创建的整个文件夹,并将其移动到 C:\\ 之类的地方,这样更容易找到文件并运行它。

or if you have any other drive like D:\\ or E:\\ , move it there and try to run the program from the Command Line.或者,如果您有任何其他驱动器,例如 D:\\ 或 E:\\ ,请将其移动到那里并尝试从命令行运行该程序。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM