简体   繁体   English

在pydev中使用anaconda环境时,为什么找不到Eclipse报告解释器?

[英]Why is Eclipse reporting Interpreter not found when using an anaconda environment with pydev?

I have installed anaconda with python 3.6 but I need to use tensorflow for an assignment I am working on. 我已经用python 3.6安装了anaconda,但是我需要使用tensorflow进行分配。 That means using python 3.5. 这意味着使用python 3.5。

I have set up a new environment in anaconda with python 3.5 and everything runs fine from command line but when I try to run in eclipse, if I select the python 3.5 executable, (window --> preferences --> pydev --> interpreter). 我已经在anaconda中使用python 3.5设置了新环境,并且一切都可以从命令行正常运行,但是当我尝试在eclipse中运行时,如果我选择python 3.5可执行文件,(窗口->首选项-> pydev->解释器)。 I get the following when I attempt to run. 当我尝试运行时,得到以下提示。

在此处输入图片说明

I am using pydev with eclipse Neon. 我在Eclipse Neon中使用pydev

Using Auto-Config for 'python interpreters' selection works fine except it does not find the new environment and reverts to python 3.6. 使用自动配置进行“ python解释器”选择可以很好地工作,除非它找不到新的环境并恢复为python 3.6。

Browsing to the 3.5 executable actually accepts the executable and seems to recognise the packages. 浏览到3.5可执行文件实际上接受了该可执行文件,并且似乎可以识别软件包。

在此处输入图片说明

However, why I try to run I get the interpreter not found error even though I have just listed it. 但是,为什么我尝试运行,尽管我刚刚列出了解释器,但还是得到了未找到解释器错误。

Any ideas? 有任何想法吗?

The problem is that you previously had an interpreter named python (you can change the name of your interpreter by double-clicking it in the preferences), and you have either associated that python interpreter to the project or run configuration, so, when it's running, it's looking for an interpreter named python and failed to find it. 问题是您以前有一个名为python的解释器(可以通过在首选项中双击来更改解释器的名称),并且已将该python解释器与项目关联或运行配置,因此,在运行时,它正在寻找一个名为python的解释器,但找不到它。

The solution is either renaming your current interpreter to python or going to the project/run configuration and changing the association to either use the Default configured interpreter or associating it with the new interpreter by its new name. 解决方案是将当前的解释python命名为python或者转到项目/运行配置,并将关联更改为使用默认配置的解释器,或将其与新解释器的新名称相关联。

As a note, unless you're in some company which uses pre-defined custom configurations, the recommended approach is always using the default interpreter. 注意,除非您所在的公司使用预定义的自定义配置,否则建议的方法始终是使用默认解释器。

Go to Windows --> preferences --> python Interpreter --> quick auto config --> apply`. 转到Windows->首选项-> python解释器->快速自动配置->应用`。 Follow the Below Image 跟随下面的图片

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

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