Cannot exec python postprocessor file on a MacBook

Hi,

I'm new here so excuse me if I wasn't able to find the existing discussion if there is any.
I need help since I'm both new to Mac and new to python. The following error gets returned whenever I slice something:
<Slic3r> Can't exec "/Users/fabian/Documents/Slic3r/postprocessor.py": No such file or directory at /Applications/Slic3r.app/Contents/MacOS/local-lib/lib/perl5/Slic3r/Print.pm line 159.
I use Repetier-Host 1.2.1, Slic3r 1.3.0, Python 3.10. on macOS Monterey. 
Within Slic3r preferences and the output options I put this: /Users/fabian/Documents/Slic3r/postprocessor.py
I had to use the following executable for slic3r within Repetier-Host preferences: /Applications/Slic3r.app/Contents/MacOS/slic3r
Otherwise the integrated slic3r would return very weird gcodes, but that's another unimportant issue. 
In a terminal window I added the path for the post processor: 
cd /Users/fabian/Documents/Slic3r/
chmod +x postprocessor.py
The postprocessor is very crucial as it modifies the gcode to fit to a cellink bio printer which uses slightly altered codes.

I am willing to try your suggestions and appreciate help in any form.

Thanks,
Fabian

Comments

  • Can you start postprocessor manually like you want? That requires first line to look like

    #!python3 or python2 eventually with path

    or so and x flag being set. But it needs to open it self in python to work. Otherwise you need to start python and give it the script as parameter. I guess it is something like that. Don't use python my self and the problem is within slic3r which is not our software so not so familiar with that special function.
  • How do I start the script manually?
    When I double-click it it opens in Idle and the script is displayed with some commands being colored. 
  • The first line reads:
    #!/usr/bin/python
  • If you can start it in your terminal then it should probably work (assuming the command replacement works there as well).
    Does /usr/bin/python exist and lead to correct python version? With latest release Apple removed python 2 in Monterey and python 3 is not backward compatible 100%. If you need a special version replace path with correct path for required version.
  • Ok, I got there by using the terminal, typing cd usr/bin/python and then double clicking the terminal window headline. 
    (I don't know how one would access this path normally ... anyway)
    I found the "python3" file there but not such thing as just "python". When I double-click it, the system asks for the "command line developer tools" to be installed, should I?
    Repetier said:
     If you need a special version replace path with correct path for required version.
    Could you please detail this step for me a little? I'm guessing I would have to download/install another python version and replace the first line in my post-processor script? 
  • cd changes directory and python is executeable so "cd usr/bin/python" makes no sense apart from bing reletive. Try
    ls -l /usr/bin/python*
    to see your installed python executeables in /usr/bin. Check also
    ls -l /usr/local/bin/python*

    I have so many python versions on my pc I can't say which is originally from apple if any. As said python 2 is not included any more in Monterey, but was in older versions.
     If you do not have a proper python version check google. As said I'm not using actively python as I do not know that language from programming. Just from some scripts using it.

    Anyhow try just typing
    python
    and at the end press tab 2 times to see possible commands starting with that. Then check that file + script as parameter and gcode file as second parameter if it works with your python script. It is not from us so can not say anything about it.

  • Good morning,
    I tried the things you suggested and what worked in the end is the following:
    (Disclaimer: I checked with "s -l /usr/bin/python*" and "ls -l /usr/local/bin/python*" and I only have python3)
    -Putting the "3" at the end of the starting command of the script so it goes "#!/usr/bin/python3"
    -Downloading and installing the developer tools for the command line (though the Mac did this automatically after asking .. so I don't actually know what was actually installed and I also don't know how to uninstall it therefore)

    Nevertheless everything is working now as it's supposed to! Thank you so much for your support :)

Sign In or Register to comment.