Python "path" problems when upgrading to 7.4

Posted on
Sat Jan 04, 2020 4:31 pm
dawson1331 offline
Posts: 32
Joined: Oct 22, 2012

Python "path" problems when upgrading to 7.4

I upgraded to 7.4 this week. For the most part it went smoothly. The bumpy part has to do with my Python files. Over the last several months I have converted all of my Apple scripts to Python. I moved them all to the 7.3/Scripts/Attachments directory - from /Library/Python/2.7/site-packages. I like having them under the Perceptive Automation directory hierarchy - they are easier to find and easier to backup, etc.

Upgrading to 7.4 they were not moved to the 7.4/Scripts/Attachments directory. It took me a few minutes to figure that out. Then I noticed that if I changed a Python module, it sometime ran with the new code and sometimes ran the old code. After several hours I figured out that the Schedules and Triggers whose Actions ran a Python file (as opposed to an embedded Python) ran the files from the 7.3 directory hierarchy. Where as Actions that ran embedded Python ran from the 7.4 directories (at least that's what I believe so far). It seems that the full path name is stores in the Action. Now it seems that I have to track down all of these types of actions and rebind them to the files in the 7.4 directory.

What am I doing wrong. Where am I supposed to put the Python files?

Thanks,

Bill

Posted on
Tue Jan 07, 2020 11:32 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Python "path" problems when upgrading to 7.4

This is a relatively common question/problem, and we're looking for ways of making this easier.

First, for shared stuff, we now make anything available in the Scripts/Attachments subdirectory available to any Indigo Python instance (scripts or plugins). The installer currently doesn't move files in that folder over, but I believe we'll have that corrected in the next installer (7.4.1 - continue reading for how we're going to handle this).

References to external scripts is a stickier problem as it would require some non-trivial work in the server to automatically detect if a script is within the install hierarchy and do the appropriate path trickery. We've settled on having the next installer create these directories:

Code: Select all
/Library/Application Support/Perceptive Automation/Scripts/
/Library/Application Support/Perceptive Automation/Python2-includes/


These are outside of the directories specific to a version of Indigo but are still in the installation hierarchy (so you can continue to just backup the entire /Library/Application Support/Perceptive Automation/ directory such that restoring that will restore everything). It does mean that shared scripts and libraries are not Indigo version specific, but we think that's an acceptable qualifier.

The latter directory will supercede the old Scripts/Attachments folder. In fact, the old Scripts folder will disappear entirely in the next release. To be clear, it's this one that will disappear:

Code: Select all
/Library/Application Support/Perceptive Automation/Indigo 7(.x)/Scripts


The next installer will move anything from this directory:

Code: Select all
/Library/Application Support/Perceptive Automation/Indigo 7(.x)/Scripts/Attachments/


to this directory:

Code: Select all
/Library/Application Support/Perceptive Automation/Python2-includes/

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Feb 07, 2020 2:20 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Python "path" problems when upgrading to 7.4

Indigo 7.4.1 is now available and includes the changes Jay details above.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests