[英]PyCharm not finding Anaconda Python, giving "can't open file 'python': [Errno 2] No such file or directory?"
I am new to Python.我是 Python 的新手。 Installed Anaconda on my system.
在我的系统上安装了 Anaconda。 I installed PyCharm too.
我也安装了 PyCharm。 When I try to run a file from PyCharm I get this error message:
当我尝试从 PyCharm 运行文件时,我收到以下错误消息:
C:\\Python\\Test\\venv\\Scripts\\python.exe python 3.6 C:/Python/Test/while.py C:\\Python\\Test\\venv\\Scripts\\python.exe: can't open file 'python': [Errno 2] No such file or directory
C:\\Python\\Test\\venv\\Scripts\\python.exe python 3.6 C:/Python/Test/while.py C:\\Python\\Test\\venv\\Scripts\\python.exe:无法打开文件“python”: [Errno 2] 没有那个文件或目录
You have mentioned that you have already installed the Anaconda in your system.您已经提到您已经在系统中安装了 Anaconda。 You can try the following,
您可以尝试以下方法,
You should now be able to see the libraries in the Project Interpreter.您现在应该能够在 Project Interpreter 中看到这些库。
It seems that you have virtual environment installed without python version.您似乎安装了没有 python 版本的虚拟环境。 If you are new to Python, it may be better if you follow the easiest path: download python 2.7 or 3.6 from Python website .
如果您是 Python 新手,最好遵循最简单的路径:从Python 网站下载 python 2.7 或 3.6。
If you run the installer, you should find the python folder in C:\\Python27 or C:\\Python36.如果您运行安装程序,您应该会在 C:\\Python27 或 C:\\Python36 中找到 python 文件夹。
Then you should assert that this folder is in windows paths, set them in Enviromental variables in System property.然后你应该断言这个文件夹在 windows 路径中,在系统属性的环境变量中设置它们。
For the last step you need to set Python interpreter in PyCharm:对于最后一步,您需要在 PyCharm 中设置 Python 解释器:
File -> Settings -> Build, Execution, Deployment -> Console -> Python Console -> Python interpreter文件 -> 设置 -> 构建、执行、部署 -> 控制台 -> Python 控制台 -> Python 解释器
and set as interpreter the python.exe file in your X:/PythonNN folder并将 X:/PythonNN 文件夹中的 python.exe 文件设置为解释器
在 Conda Environment 下,您可以尝试选择 X:\\Anaconda3\\Scripts\\conda.exe。
我遇到了同样的问题,然后通过以管理员身份运行 PyCharm 解决了它。
您使用的命令是错误的,请尝试:
C:\Python\Test\venv\Scripts\python3.exe C:/Python/Test/while.py
I had the same problem with the Pycharm Community Edition (CE).我在 Pycharm 社区版 (CE) 上遇到了同样的问题。 Solved it by switching to Pycharm Professional.
通过切换到 Pycharm Professional 解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.