Python error when trying to run post processing script
 
Notifications
Clear all

Python error when trying to run post processing script  

  RSS
gb160
(@gb160)
Reputable Member
Python error when trying to run post processing script

Hi, apologies if this has been asked but I'm awaiting support to get back to me, as they've passed this issue onto the Prusaslicer devs.

Long story short, I have a couple of post processing scripts that work fine when run from PS on my MacBook Pro (Which is getting on now , 2018 model)

I recently upgraded to a M4 Mac Mini, everything installed a running fine, except when I try my known working post processing scripts via PS , I get some long python error message.
In a nutshell it seems on the Mac Mini PS isn't using the default python3 installation. For some unknown reason PS is using the python3 that is installed as part of Autodesk Fusion. And due to modules being missing the script fails.

If I export the gcode from PS, I can manually run my post processing scripts and everything is fine. It's just a PITA to have to keep doing this and I'd like to get everything integrated into PS....first-world problems , I know 🤣

If anyone has any ideas or run into this (or anything similar), then please comment.

Cheers. 

 

Edit: I've tried using the full path to the python3 executable (/usr/bin/python3) , but that made no difference. That is the executable that is used when I successfully run the scripts from terminal.

Posted : 06/08/2025 9:40 pm
_KaszpiR_
(@_kaszpir_)
Noble Member
RE:

You probably have different python version spawned when using shell or not, you can adjust it by setting PATH environment variable per app

See 

https://www.cyberciti.biz/faq/appleosx-bash-unix-change-set-path-environment-variable/

https://docs.python.org/3/using/mac.html

 

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 07/08/2025 6:43 am
1 people liked
gb160
(@gb160)
Reputable Member
Topic starter answered:
RE: Python error when trying to run post processing script

Thanks, yes that seems to be the problem. 
I've no idea how this issue arose, on my Mac Mini I've only installed like 4 application, PS, Fusion, and a couple of unrelated apps...and Im using the python3 installation that is pre-installed with MacOS.

 

Posted : 07/08/2025 7:31 am
gb160
(@gb160)
Reputable Member
Topic starter answered:
RE: Python error when trying to run post processing script

Just as a note of reference incase anyone else stumbles across this issue:

Just run PS via terminal with :

 /Applications/Original\ Prusa\ Drivers/PrusaSlicer.app/Contents/MacOS/PrusaSlicer

Check you can run PP scripts from that instance of PS.

Now when I open and use PS and PP scripts everything is now working. No need to edit paths or anything else. Running PS from the CLI once is all I needed to do.

Posted : 07/08/2025 8:33 am
1 people liked
_KaszpiR_
(@_kaszpir_)
Noble Member
RE: Python error when trying to run post processing script

Yeah this works because those env vars are modified for shell such as bash or zsh.

Another option is to make a custom app launcher to spawn process vis terminal or set path accordingly ( though I havent used it for literally years so maybe it is different in modern os x)

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 08/08/2025 5:16 am
1 people liked
Share: