Page 1 of 1
[SOLVED]Python module via scripting host vs. embedded script
Posted:
Fri Feb 17, 2017 6:41 am
by OjisanSeiuchi
Can someone describe to me why a confirmed, properly- installed module can be imported in the plugin host shell but not in an embedded script?
The module in question is `rrdtool` which are the Python bindings for rrdtool. I've properly installed the module in the Python 2.7 site-packages via:
- Code: Select all
sudo easy_install rrdtool
and I can import the module in the plug-in host shell:
- Code: Select all
import rrdtool
However, when I try to import the module via an embedded script, Indigo complains that the module isn't found.
What am I missing?
Re: Python module via scripting host vs. embedded script
Posted:
Fri Feb 17, 2017 9:38 am
by jay (support)
Have you restarted the Indigo server since you installed it? Also try the Plugins->Reload Libraries and Attachments menu item first.
Re: Python module via scripting host vs. embedded script
Posted:
Fri Feb 17, 2017 12:29 pm
by OjisanSeiuchi
Thanks Jay. Yes, I've both reloaded the libraries from the menu option and restarted the server. Neither seems to expose the module. I have no problem importing the module in the plugin host shell but not in an embedded script.
Re: Python module via scripting host vs. embedded script
Posted:
Fri Feb 17, 2017 3:20 pm
by jay (support)
What is the exact path to the site-packages directory where it's installed?
Also, which version of Indigo are you using?
Re: Python module via scripting host vs. embedded script
Posted:
Fri Feb 17, 2017 3:38 pm
by OjisanSeiuchi
(Indigo 7.0.2, Python 2.7.10)
However...
It appears that this was related to a conflicting Python installation. At some point, I must have installed 2.7 via homebrew in the remote past that then was left in place after the system Python upgraded to 2.7. Uninstalling the second (non-system) Python 2.7 seems to have resolved the conflict. All is fine now. Thanks.
Re: Python module via scripting host vs. embedded script
Posted:
Fri Feb 17, 2017 5:43 pm
by jay (support)
That's why I asked for the exact path - we've had a few users with that issue. Glad it's working now.
Re: [SOLVED]Python module via scripting host vs. embedded sc
Posted:
Tue Aug 01, 2017 12:03 pm
by dscottbuch
I'm having a similar problem. I'm running 10.12.6 and Indigo 7.0.3. I just removed all my MacPorts installed pythons and am back to using the included /usr/bin/python. I stopped and started the server. When I run Plugins->Open Scripting Shell I get a blank page in the terminal in which I can type but get no response. CTRL-D does nothing. I have to terminate the terminal to get out. Any help appreciated. I'm trying to move my AppleScript to Python.
Re: [SOLVED]Python module via scripting host vs. embedded sc
Posted:
Tue Aug 01, 2017 1:29 pm
by jay (support)
Open a terminal window and type the following commands in order one at a time. Make sure that you've rebooted your Mac since you removed any other Python installs.
Copy/paste the results:
- Code: Select all
which python
python -c "import sys; print(sys.version)"
/Library/Application\ Support/Perceptive\ Automation/Indigo\ 7/IndigoPluginHost.app/Contents/MacOS/IndigoPluginHost -e "import sys; print(sys.version)"
Be careful to select the entire last line - unfortunately, it gets cut off in the forum post but it will scroll.
Re: [SOLVED]Python module via scripting host vs. embedded sc
Posted:
Wed Aug 02, 2017 11:15 am
by dscottbuch
Two things.
1) My problem was actually that I'm running the server from launchd so the process is owned by root so I needed to run 'sudo ./IndigoPluginHost -i' - That worked.
2) Given that I then enabled the 'Global Property Manager' and the shell no longer worked. I got it back by dialing the GPM.
Thanks,
Re: [SOLVED]Python module via scripting host vs. embedded sc
Posted:
Wed Aug 02, 2017 12:17 pm
by jay (support)
Your own launch document rather than the one Indigo manages?