USB驱动器中的PyDev解释器指示 [英] PyDev interpreter indication within USB drive

查看:102
本文介绍了USB驱动器中的PyDev解释器指示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PortableApps应用程序,并安装了便携式Eclipse和便携式python。我为eclipse配备了PyDev插件,使我可以在任何所需的基于Windows的平台上运行和调试文件。问题是为了在USB记忆棒中使用解释器,我需要在PyDev设置中解决python解释器的正确位置。如果将USB驱动器连接到不同的计算机,则我的USB记忆棒会得到不同的驱动器号,这会在定位USB记忆棒内部已安装的python的路径时出现问题。
是否可以执行eclipse的PyDev插件来查找永久安装在我的USB内的python解释器?!

I'm using PortableApps application with portable eclipse and portable python installed. I've equipped my eclipse with PyDev plugin enabling me to run and debug my files on whatever windows-based platform I'd like. The problem is in order to use the interpreter inside my USB stick, I need to address the proper location of the python interpreter in PyDev settings. with USB drive connected to different computers, I get different drive letter for my USB stick which would make problem locating the path of the installed python inside my USB stick. Is there any way to enforce eclipse's PyDev plugin to look for python interpreter which is installed inside my USB permanently?!

推荐答案

<我将便携式Eclipse置于版本控制之下。然后,我初始化了解释器设置。在提交预览中,可以看到更改后的设置存储在

I put my portable Eclipse under version control. Then I initialized the interpreter settings. In the commit preview it's possible to see that the altered settings are stored in


workspace / .metadata / .plugins / org.eclipse.core中.runtime / .settings / org.python.pydev.prefs

workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.python.pydev.prefs

我用相对路径替换了绝对路径(正如其他人已经指出的那样)答案)使用搜索/替换,例如

I replaced the absolute paths with relative ones (as already stated by other answers) using search/replace, e.g.

D\:\\EclipsePython\\App  => {eclipse_home}\\..\\App\

,保存后重新启动Eclipse设置文件。

and restarted Eclipse after saving the settings file.

PyDev的解释器设置对话框显示相对路径(也适用于不能直接编辑的库路径)。 (如果弹出窗口要求您应用检测到的更改,请选择忽略它们。)

The interpreter settings dialog of PyDev shows the relative paths (also for the library paths that can not be edited directly). (If a popup asks you to apply detected changes, choose to ignore them.)

我能够使用该可移植设置运行python程序。

I am able to run my python program with that portable settings.

这篇关于USB驱动器中的PyDev解释器指示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆