使用 pydev/eclipse 时“无法启动选择并且最近没有启动”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8782557/
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-10 20:49:15  来源:igfitidea点击:

"selection cannot be launched and there are no recent launches" when using pydev/eclipse

eclipsepydev

提问by Lostsoul

I am getting the above error when launching a python file that worked in the past. I think I know how this happened but not sure how to fix it. I have 2 computers dual booting different os and use dropbox to stay synced between them all. In the past I synced my eclipse workspace with my mac and windows computers this way and everything worked fine(except I would have to change the location of the python interpreter depending on what system I was using).

启动过去工作的python文件时出现上述错误。我想我知道这是怎么发生的,但不知道如何解决。我有 2 台计算机双启动不同的操作系统,并使用 Dropbox 在它们之间保持同步。过去,我以这种方式将我的 eclipse 工作区与我的 mac 和 windows 计算机同步,并且一切正常(除了我必须根据我使用的系统更改 python 解释器的位置)。

I started getting the above message after I added a linux(fedora) to share dropbox files. But my problem is now when I try to update my python interpreter(in windows) it doesn't save my setting. I can hit autoconfig and it'll find the python path and all the files and I hit apply/okay, but when I go back its all blank. I'm pretty sure the linux machine messaged my settings up, but I need to develop on all 3 boxes so I need them to be kind of synced.

添加 linux(fedora) 以共享 Dropbox 文件后,我开始收到上述消息。但是我现在的问题是当我尝试更新我的 python 解释器(在 Windows 中)时,它没有保存我的设置。我可以点击自动配置,它会找到 python 路径和所有文件,然后我点击应用/好的,但是当我返回时它全是空白。我很确定 linux 机器已将我的设置发送给我,但我需要在所有 3 个机器上进行开发,因此我需要将它们同步。

Wondering how to fix this and if there's another way to do this so I don't have this problem in the future?

想知道如何解决这个问题,以及是否有另一种方法可以做到这一点,以便我将来不会遇到这个问题?

update: this def. has something to do with my workspace. When I change the default workspace to a new folder and set the python interpreter it works. Still not sure how to permanently fix this(don't want to have to copy code back and forth to new workspaces.

更新:这个定义。与我的工作区有关。当我将默认工作区更改为新文件夹并设置 python 解释器时,它可以工作。仍然不确定如何永久解决此问题(不想将代码来回复制到新工作区。

采纳答案by Lostsoul

I think an answer of how to share workspace among other enviroments is still very helpful but if anyone is having a simlair problem and just needs to fix it to work quickly here's the solution:

我认为如何在其他环境中共享工作区的答案仍然非常有帮助,但如果有人遇到类似问题并且只需要修复它以快速工作,这里是解决方案:

  1. go to File, switch workspaces and figure out where your workspace is located
  2. Go to that folder and rename the .metadata folder and relaunch eclipse
  3. In eclipse everything will be missing, so go to file-->import and import the folder with all your projects(do the root folder of all the projects so you don't have to import each one individually).
  4. setup any customizations you had before
  1. 转到文件,切换工作区并找出您的工作区所在的位置
  2. 转到该文件夹​​并重命名 .metadata 文件夹并重新启动 eclipse
  3. 在 Eclipse 中,一切都会丢失,所以转到文件--> 导入并导入包含所有项目的文件夹(执行所有项目的根文件夹,这样您就不必单独导入每个项目)。
  4. 设置您之前的任何自定义设置

This is not the best solution but it works. Hopefully someone else has a way of preventing this problem from happening in multiple environments.

这不是最好的解决方案,但它有效。希望其他人有办法防止这个问题在多个环境中发生。

回答by Justin Harris

It seems the preferred way is through F9: http://pydev.org/manual_adv_launch.html

似乎首选的方式是通过 F9:http: //pydev.org/manual_adv_launch.html

回答by Ahmad

eclipse run as same as what it run last time. then first time run in this way. in package explorer (left). doubleclick res then menu. then rightclick main menu (name.xml). frmo menu select run then run as application. and you can run as default in next time(from menu or shortcut).

eclipse 的运行方式与上次运行的一样。然后第一次以这种方式运行。在包浏览器中(左)。双击 res 然后菜单。然后右键单击主菜单(name.xml)。frmo 菜单选择运行然后作为应用程序运行。并且您可以在下次默认运行(从菜单或快捷方式)。

回答by demongolem

This problem can often be solved by exiting out of eclipse and restarting (if that happens to be convenient for you). Changing workspaces midstream can often confuse Eclipse even if PyDev is correctly configured.

这个问题通常可以通过退出 eclipse 并重新启动来解决(如果这对您来说方便的话)。即使正确配置了 PyDev,在中途更改工作区也经常会混淆 Eclipse。