Eclipse:“未配置 Python”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10669846/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:12:26  来源:igfitidea点击:

Eclipse: "Python not configured"

pythoneclipsepydev

提问by KPG

Here is a screenshot of whats happening:

这是正在发生的事情的屏幕截图:

Python not configured

未配置 Python

Basically, I execute everything via command line but edit the source in eclipse.
This error prevents autocomplete which is annoying.

基本上,我通过命令行执行所有操作,但在 eclipse 中编辑源代码。
此错误会阻止自动完成,这很烦人。

I have gone to window>preferences>PyDev>Interpreter - Pythonand set the correct values but they don't stay and even when I hit apply they don't seem to take for the current session.

我已经去window>preferences>PyDev>Interpreter - Python设置了正确的值,但它们不会留下来,即使我点击应用,它们似乎也不会用于当前会话。

Any idea on what could cause this error message?

关于什么可能导致此错误消息的任何想法?

回答by MHosafy

What also works is RClick --> PyDev --> Remove PyDev Project Config.

同样有效的是 RClick --> PyDev --> 删除 PyDev 项目配置。

steps_screen_shoot

steps_screen_shoot

Please note that the error marker may not be removed even after a clean/build, you may have te delete the marker manualy (just select it and delete) then clean, build and run

请注意,即使在清理/构建之后,错误标记也可能不会被删除,您可能需要手动删除标记(只需选择并删除),然后进行清理、构建和运行

P.S.: I couldn't find the "project nature" option mentioned in the voted answer.

PS:我找不到投票答案中提到的“项目性质”选项。

回答by Mudassir Hussain

Go to Window → Preferences. In the Preferences window, expand PyDev and select Interpreter-Python. Click "New..." and type Python32 for the Interpreter name. For the Interpreter executable, browse to your copy of Python (C:\Program Files\Python32\python.exe), and press Open.

转到窗口 → 首选项。在 Preferences 窗口中,展开 PyDev 并选择 Interpreter-Python。单击“新建...”并键入 Python32 作为解释器名称。对于解释器可执行文件,浏览到您的 Python 副本 (C:\Program Files\Python32\python.exe),然后按打开。

回答by Zender

Project Properties > Project Natures and uncheck the python thing.

Project Properties > Project Natures 并取消选中 python 的东西。

回答by Monis Majeed

       1. Select your project and right click and click on Properties
       2. Select PyDev-Interpreter/Grammer,click on "Click here to configure an    
          Interpreter not listed" Link.

回答by Mian Asbat Ahmad

On Mac,

在 Mac 上,

open eclipse application,   
click preferences    
click PyDev    
Click Interpreter  
Click Python Interpreter  (below Figure 1)
Click Choose from List button (below Figure 2)
Select what ever Python version you want to use  
Click Apply  
Click OK   
Exit Eclipse
ReOpen it and all fixed.

enter image description hereenter image description here

在此处输入图片说明在此处输入图片说明

回答by VonC

The permssion issue (mentioned for .pydevprojectin "How to persist PYTHONPATHsetting of an Eclipse Pydev project?") can easily happen in a DropBox settings when used by multiple users.

当多个用户使用时,权限问题(.pydevproject在“如何持久PYTHONPATH设置 Eclipse Pydev 项目?”中提到)很容易在 DropBox 设置中发生。

See for instance "How to fix Drop Box permissions issues in 10.5" (if you are on a Mac, but the general idea applies for other unix-like OS too)

例如,请参阅“如何在 10.5 中修复 Drop Box 权限问题”(如果您使用的是 Mac,但总体思路也适用于其他类似 Unix 的操作系统)

The permanent fix to this problem is to add the proper ACL to the Drop Box folder.
To do that, open Terminal, and enter this command—note that you can't just copy and paste it as is, as you need to replace the two occurrences of short_username with your user's actual short username.
For that reason, I suggest copying this into TextEdit, editing it as needed, and then pasting it into Terminal.

此问题的永久修复是将正确的 ACL 添加到 Drop Box 文件夹。
为此,请打开终端,然后输入此命令 - 请注意,您不能按原样复制和粘贴它,因为您需要将两次出现的 short_username 替换为用户的实际短用户名。
因此,我建议将其复制到 TextEdit 中,根据需要进行编辑,然后将其粘贴到终端中。

chmod +a "short_username allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown,file_inherit,directory_inherit" /Users/short_username/Public/Drop\ Box

After running this command, you should find that your Drop Box works as expected, and you have full rights to files that others leave for your use

运行此命令后,您应该会发现您的 Drop Box 正常工作,并且您拥有其他人留给您使用的文件的完全权限