简体   繁体   English

更改Gimp python解释器路径

[英]Change Gimp python interpreter path

I am developing a custom GIMP plugin on Mac OS X. For programming reasons, I need to use some python modules that I have installed in system's default python environment (such as OpenCV, MoviePy, and some others), but I am unable to import them on the Python-Fu console because it uses the GIMP's app built-in python environment. 我正在Mac OS X上开发自定义GIMP插件。出于编程原因,我需要使用系统默认的python环境中安装的一些python模块(例如OpenCV,MoviePy等),但无法导入它们在Python-Fu控制台上使用,因为它使用GIMP的应用程序内置的python环境。 My question is. 我的问题是。 Is there a way to tell GIMP to use another python interpreter? 有没有办法告诉GIMP使用另一个python解释器? I've searched on GIMP preferences but I haven't found anything such as Python-Fu path or something similar. 我已经搜索了GIMP首选项,但没有找到任何类似Python-Fu path之类的东西。

GIMP's Python interpreter is found here on my system: /Applications/GIMP.app/Contents/MacOS/python GIMP的Python解释器可在我的系统上找到: /Applications/GIMP.app/Contents/MacOS/python

The interpreter that I want GIMP to use is found here on my system: /usr/bin/python 我希望GIMP使用的解释器可以在我的系统上找到: /usr/bin/python

Thanks! 谢谢!

See /usr/lib/gimp/2.0/interpreters/pygimp.interp (or wherever this is in your Gimp installation directory). 请参阅/usr/lib/gimp/2.0/interpreters/pygimp.interp (或位于Gimp安装目录中的任何位置)。 You can tweak this to use another Python instance (but it still has to be 2.7.x). 您可以调整它以使用另一个Python实例(但仍然必须是2.7.x)。 On the other hand Gimp's own Python interpreter is the standard cpython, you can use it directly in the command line and can likely tweak pip to install modules for it (or add the modules installed on the other instance to it). 另一方面,Gimp自己的Python解释器是标准的cpython,您可以直接在命令行中使用它,并且可以调整pip为其安装模块(或向其添加其他实例上安装的模块)。

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

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