Pycharm interpreter config?

Posted on
Fri Jan 28, 2022 10:35 pm
johnofcamas offline
Posts: 36
Joined: Jan 30, 2014

Pycharm interpreter config?

I'm getting started with writing some scripts that I want to execute (not as a plugin) to control indigo using "indigo-host", but PyCharm won't allow me to set indigo-host as the interpreter.

How can I set up PyCharm for development?

Posted on
Sat Jan 29, 2022 7:51 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Pycharm interpreter config?

I don't know if it's possible to set up an Indigo scripting shell in PyCharm--I don't know of anyone that's done it. For plugin development, Indigo and PyCharm support "remote debugging" which allows you to step through code line by line to find errors more quickly, but you're still running the plugin within Indigo (not within PyCharm).

For your situation, I set up an Action Group which runs a linked script and use PyCharm to write the code (gives you autocomplete, syntax checking, etc.) Make changes, pop over to the Indigo UI and execute the action.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Jan 29, 2022 10:54 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Pycharm interpreter config?

johnofcamas wrote:
I'm getting started with writing some scripts that I want to execute (not as a plugin) to control indigo using "indigo-host", but PyCharm won't allow me to set indigo-host as the interpreter.

How can I set up PyCharm for development?


This would be really amazing, but I do what Dave does. Sometimes I will use PyCharm to write the parts of the script that don't require Indigo, hardcoding variable values etc... Then when it's all working I move it to the server and use the Action Group to fire it off.

In some situations where the code is logical, I do a test to see if I can import indigo. If not, I create logic to skip the parts of the script that interact with Indigo. For example, I have a script that goes out to nutrislice.com and pulls the breakfast and lunch menu items for the kids' schools. I put the results into indigo variables so they can ask Alexa what's for lunch today? When it's not connected to indigo, I print out the results (for debugging) and when it is connected to indigo I update the proper variables.

Posted on
Sat Jan 29, 2022 12:45 pm
johnofcamas offline
Posts: 36
Joined: Jan 30, 2014

Re: Pycharm interpreter config?

DaveL17 wrote:
I don't know if it's possible to set up an Indigo scripting shell in PyCharm--I don't know of anyone that's done it. For plugin development, Indigo and PyCharm support "remote debugging" which allows you to step through code line by line to find errors more quickly, but you're still running the plugin within Indigo (not within PyCharm).

For your situation, I set up an Action Group which runs a linked script and use PyCharm to write the code (gives you autocomplete, syntax checking, etc.) Make changes, pop over to the Indigo UI and execute the action.


I'll give that a shot, thanks

Posted on
Sat Jan 29, 2022 1:52 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Pycharm interpreter config?

All python scripts that speak to the indigo module must run inside an IndigoHostProcess, which is not a python interpreter. As mentioned above, you can use the remote debugging feature of PyCharm to debug a plugin.

So it really depends on what features of PyCharm you want: debugging scripts, while it may be possible given a bunch of weird config stuff, won't work since Indigo scripts can't run directly in a Python interpreter. You can use the other language features, like syntax checking, etc, though - just select python 2 as the interpreter for your project and all the inspections will work. You can probably get your script to run by creating an external task (you can't use the built-in run configuration) or you can just open the terminal tab and run it there using:

Code: Select all
indigo-host -x indigo-script.py

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 13 guests