简体   繁体   English

PyDev内容辅助:'找到的解释器位置不存在。'

[英]PyDev content assist: 'The interpreter location found does not exist.'

I'm slowly getting more productive with Python, and would like to move from Spyder to PyDev. 我正在慢慢地利用Python提高效率,并希望从Spyder转移到PyDev。 I can run my code fine, but the content assist ([ctrl]+[space]) feature of Eclipse isn't working -- any ideas? 我可以正常运行我的代码,但Eclipse的内容辅助([ctrl] + [space])功能不起作用 - 任何想法?

When I run the code ([ctrl]+[F11]), it executes fine, and when I open an interactive terminal ([alt]+[ctrl]+[enter], choose Python console), the suggestions I expect come up (though [ctrl]+[space] still gives this error). 当我运行代码([ctrl] + [F11])时,它执行正常,当我打开一个交互式终端([alt] + [ctrl] + [enter],选择Python控制台)时,我期望的建议出现了(虽然[ctrl] + [space]仍然会出现此错误)。

The full error given in the tooltip is: 工具提示中给出的完整错误是:

    The interpreter location found does not exist. <xml>
    <name>Python27</name>
    <version>2.7</version>
    <executable>python</executable>
    <lib>C:\Python27\lib\site-packages\control-0.6c-py2.7.
     egg</lib>
    <lib>C:\Python27\DLLs</lib>
    <lib>C:\Python27\lib</lib>
    <lib>C:\Python27\lib\lib-tk</lib>
    <lib>C:\Python27</lib>
    <lib>C:\Python27\lib\site-packages</lib>
    <lib>C:\Python27\lib\site-packages\FontTools</lib>
    <lib>C:\Python27\lib\site-packages\itk</lib>
    <lib>C:\Python27\lib\site-packages\win32</lib>
    <lib>C:\Python27\lib\site-packages\win32\lib</lib>
    <lib>C:\Python27\lib\site-packages\Pythonwin</lib>
    <lib>C:\Python27\lib\site-packages\wx-2.8-msw-unicode</lib>
    <lib>C:\Python27\python.exe</lib>
    <forced_lib>Image</forced_lib>
    <forced_lib>OpenGL</forced_lib>
    <forced_lib>__builtin__</forced_lib>
    <forced_lib>__main__</forced_lib>
    <forced_lib>_ast</forced_lib>
    <forced_lib>_bisect</forced_lib>
    <forced_lib>_bytesio</forced_lib>
    <forced_lib>_codecs</forced_lib>
    <forced_lib>_codecs_cn</forced_lib>
    <forced_lib>_codecs_hk</forced_lib>
    <forced_lib>_codecs_iso2022</forced_lib>
    <forced_lib>_codecs_jp</forced_lib>
    <forced_lib>_codecs_kr</forced_lib>
    <forced_lib>_codecs_tw</forced_lib>
    <forced_lib>_collections</forced_lib>
    <forced_lib>_csv</forced_lib>
    <forced_lib>_fileio</forced_lib>
    <forced_lib>_functools</forced_lib>
    <forced_lib>_heapq</forced_lib>
    <forced_lib>_hotshot</forced_lib>
    <forced_lib>_io</forced_lib>
    <forced_lib>_json</forced_lib>
    <forced_lib>_locale</forced_lib>
    <forced_lib>_lsprof</forced_lib>
    <forced_lib>_md5</forced_lib>
    <forced_lib>_multibytecodec</forced_lib>
    <forced_lib>_random</forced_lib>
    <forced_lib>_sha</forced_lib>
    <forced_lib>_sha256</forced_lib>
    <forced_lib>_sha512</forced_lib>
    <forced_lib>_sre</forced_lib>
    <forced_lib>_struct</forced_lib>
    <forced_lib>_subprocess</forced_lib>
    <forced_lib>_symtable</forced_lib>
    <forced_lib>_warnings</forced_lib>
    <forced_lib>_weakref</forced_lib>
    <forced_lib>_winreg</forced_lib>
    <forced_lib>array</forced_lib>
    <forced_lib>astropy</forced_lib>
    <forced_lib>astropy.units</forced_lib>
    <forced_lib>audioop</forced_lib>
    <forced_lib>binascii</forced_lib>
    <forced_lib>cPickle</forced_lib>
    <forced_lib>cStringIO</forced_lib>
    <forced_lib>cmath</forced_lib>
    <forced_lib>datetime</forced_lib>
    <forced_lib>email</forced_lib>
    <forced_lib>errno</forced_lib>
    <forced_lib>exceptions</forced_lib>
    <forced_lib>future_builtins</forced_lib>
    <forced_lib>gc</forced_lib>
    <forced_lib>hashlib</forced_lib>
    <forced_lib>imageop</forced_lib>
    <forced_lib>imp</forced_lib>
    <forced_lib>itertools</forced_lib>
    <forced_lib>marshal</forced_lib>
    <forced_lib>math</forced_lib>
    <forced_lib>mmap</forced_lib>
    <forced_lib>msvcrt</forced_lib>
    <forced_lib>nose</forced_lib>
    <forced_lib>nose.tools</forced_lib>
    <forced_lib>nt</forced_lib>
    <forced_lib>numpy</forced_lib>
    <forced_lib>operator</forced_lib>
    <forced_lib>os</forced_lib>
    <forced_lib>os.path</forced_lib>
    <forced_lib>parser</forced_lib>
    <forced_lib>pytest</forced_lib>
    <forced_lib>scipy</forced_lib>
    <forced_lib>signal</forced_lib>
    <forced_lib>socket</forced_lib>
    <forced_lib>strop</forced_lib>
    <forced_lib>sys</forced_lib>
    <forced_lib>thread</forced_lib>
    <forced_lib>time</forced_lib>
    <forced_lib>wx</forced_lib>
    <forced_lib>wxPython</forced_lib>
    <forced_lib>xxsubtype</forced_lib>
    <forced_lib>zipimport</forced_lib>
    <forced_lib>zlib</forced_lib>
    </xml>

Edit: comment suggestion of YerayDiazDiaz: 编辑: YerayDiazDiaz的评论建议:

Under PyDev -> Interpreter -> Python I had a single interpreter there, from "Quick Auto-Config". 在PyDev - > Interpreter - > Python下,我在那里有一个解释器,来自“Quick Auto-Config”。 It has Name="Python" and Location="python". 它有Name =“Python”和Location =“python”。 Libraries seem OK. 图书馆似乎没问题。

I've tried removing it, and adding an interpreter with "New", where I've set "Interpreter Name:"="System", "Interpreter Executable"="C:\\Python27\\python.exe". 我已经尝试删除它,并添加一个带有“New”的解释器,其中我设置了“Interpreter Name:”=“System”,“Interpreter Executable”=“C:\\ Python27 \\ python.exe”。 This seems to add the libraries OK, but now I can neither run my code (Error about invalid configuration, "Interpreter: python not found") nor use the code completion (tooltip error is "Interpreter: python not found"). 这似乎添加了库好,但现在我既不能运行我的代码(关于无效配置的错误,“解释器:找不到python”)也不使用代码完成(工具提示错误是“解释器:未找到python”)。

If I have both interpreters there (the one from Quick Auto-Config, and my own "System"), then I can run the code again, but code completion fails with the original error. 如果我有两个解释器(来自Quick Auto-Config和我自己的“系统”),那么我可以再次运行代码,但代码完成失败,原始错误。

I'm running Windows 7, 64 bit; 我正在运行Windows 7,64位; Eclipse Kepler Service Release 1; Eclipse Kepler Service Release 1; PyDev version 3.2.0.201312292215 PyDev版本3.2.0.201312292215

OK, it seems to be working now -- I had to create a new project, and for the new project everything works as expected. 好吧,它似乎现在正在工作 - 我不得不创建一个新项目,对于新项目,一切都按预期工作。

Using the "Quick Auto-Config" under "Preferences - PyDev - Interpreters - Python Interpreter" seems to be the culprit. 使用“首选项 - PyDev - Interpreters - Python Interpreter”下的“Quick Auto-Config”似乎是罪魁祸首。 Instead, I do "New...", click on Browse, find my python.exe, and select that. 相反,我做“新...”,点击浏览,找到我的python.exe,然后选择它。 If I now create a new PyDev project, the code completion works as expected. 如果我现在创建一个新的PyDev项目,代码完成按预期工作。

I was using Squish (with Python) for Automation of a Windows application. 我使用Squish(使用Python)来实现Windows应用程序的自动化。 the code completion was having issues. 代码完成有问题。 During scripting when I select "Control" + "Enter", there was an error saying - “The interpreter location found does not exist” 在脚本编写期间,当我选择“控制”+“输入”时,出现错误说 - “发现的解释器位置不存在”

Solution is as Below: 解决方案如下:

I followed the below steps and this solved the issue 我按照以下步骤解决了这个问题

(1) In Squish, go to “Edit” menu -> “Preferences” (in windows platform) (1)在Squish中,转到“编辑”菜单 - >“首选项”(在Windows平台中)

(2) In “Preferences” window, Select “PyDev” -> “Interpreter – Python” (2)在“首选项”窗口中,选择“PyDev” - >“Interpreter - Python”

(3) Remove all the entries on the right hand side and select “Auto Config” (3)删除右侧的所有条目,然后选择“自动配置”

(4) Save and re-start Squish – the issue will be gone and context assist will be seen during scripting (4)保存并重新启动Squish - 问题将消失,并且在脚本编写期间将看到上下文辅助

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

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