PyCharm-错误-找不到指定文件python.exe

1、现象

系统提示找不到指定的文件:

Error running 'hello': Cannot run program "B:\pystudy\venv\Scripts\python.exe" (in directory "\python-study"): CreateProcess error=2, 系统找不到指定的文件。

PyCharm-错误-找不到指定文件python.exe_第1张图片

2、原因

原来的工程目录(B盘)下,保存了python的编译环境,包括python.exe文件。工程目录移动到F盘以后,工程设置中找不到python.exe程序,因此报错,需要修改设置。

3、解决

打开菜单“File/Setting”。

PyCharm-错误-找不到指定文件python.exe_第2张图片

找到“Project Interpreter” ,再选择显示全部,如下图:

PyCharm-错误-找不到指定文件python.exe_第3张图片

先删除旧的程序位置。

 PyCharm-错误-找不到指定文件python.exe_第4张图片

再添加一个已有的ptyhon环境。

PyCharm-错误-找不到指定文件python.exe_第5张图片

PyCharm-错误-找不到指定文件python.exe_第6张图片

你可能感兴趣的:(python学习)