Setting up OctoPrint on MacOS

Thanks so much. I will give it a try and let you know if I have issues. This has been such a great resource.

It worked perfectly! I didn't know it would be so simple to do.

On Catalina, mjpegsw.py may crash because access to the camera needs privileges. The best way to do this is to start an app that requires camera access from the terminal. MacOS will then prompt you to give permission to terminal (and all other apps you run from the terminal). I use webcamoid, which I have installed in the Applications directory in my home directory. For this example, from the terminal, run:

~/Applications/webcamoid/webcamoid.app/Contents/MacOS/webcamoid

Add permission when prompted and from then on you can use mjpegsw.py from the terminal.

1 Like

The documentation I can find on manually setting up the webcam is all about octopi.txt on the sdcard for the pi, which obviously doesn't exist in this context.

Where does one configure the webcam settings in a virtualenv install?

Depends on which webcam server you're using.

A newbie 3Der here. Greetings to all. Wanted to say kudos to @foosel for the easy-to-follow setup guide. Had my first OctoPrint output appearing on the hotend in under an hour. Don't have a webcam yet, but I'll be back for @odie5533's setup which also looks super simple, and also someone else's suggestion for giving camera access to the terminal. Thanks also for the shell script suggestion. :fist_right: :fist_left: You know who you are - system only lets me mention two others in my first post...lol

I’d love,to know how you did it because I’ve had endless problems. Got it to work once but when I re-launched, it all went horribly wrong.

We’re not all programmers. Even though I’m pretty technical, what would be good is a set of working instructions for big surf or every single step.

:cry:

My advice would be don't set up OctoPrint on MacOS. Buy an RPi 3B+ or an RPi 4 (don't need 8GB of memory) and install OctoPi (which includes OctoPrint and some camera software pre-configured). The installation is straight forward and there is a lot more expertise available here for that configuration should you need help.

Yeah I’ve done that - it’s great but it’s not as convenient as having it all together on one device for me. Plus when I did get OctoPrint running on the Mac (it only worked once) it was so much faster for me.

How wrong are we talking? Try and explain exactly what you are seeing on the screen when you try and run it, and what you are using to launch it. Is it the octoprint serve command?

Yes it is:

Python(23990,0x10f0c9e00) malloc: can't allocate region
:*** mach_vm_map(size=18446744072267804672, flags: 100) failed (error code=3)
Python(23990,0x10f0c9e00) malloc: *** set a breakpoint in malloc_error_break to debug
init_dgelsd failed init
Traceback (most recent call last):
File "/usr/local/bin/octoprint", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/octoprint/init.py", line 937, in main
from octoprint.cli import octo
File "/usr/local/lib/python3.9/site-packages/octoprint/cli/init.py", line 273, in
from .client import client_commands # noqa: E402
File "/usr/local/lib/python3.9/site-packages/octoprint/cli/client.py", line 13, in
import octoprint_client
File "/usr/local/lib/python3.9/site-packages/octoprint_client/init.py", line 12, in
import websocket
File "/usr/local/lib/python3.9/site-packages/websocket/init.py", line 21, in
from ._abnf import *
File "/usr/local/lib/python3.9/site-packages/websocket/_abnf.py", line 37, in
import numpy
File "/usr/local/lib/python3.9/site-packages/numpy/init.py", line 286, in
raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned

I have successfully setup octoprint on Mojave and it's working fine but how can I access the boot/octopi.txt to edit camera settings for octolapse?

Hi all,

Have a dumb question now that I have this installed and running... how do I restart Octoprint when I install plugins, etc.

Thanks!

Hello @chrisale !

Usually, after installing a plugin, OctoPrint asks for restart Else you can restart via the system menu:

grafik

Ooops - just saw its on a Mac - it may be different - but I assume not

anyone got this working on Big Sur?
I've tried installing the FTDI / CH340 drivers as well, the serial port shows up as /dev/uc.serial0 but octoprint is still unable to connect (handshake fails)

Very new to all of this so my apologies.
I am trying to install OctoPrint on macOS Monterey

I followed the instructions and everything seems fine until I actually try to launch Octoprint. I get error:

2022-02-07 15:27:17,522 - octoprint.cli.server - ERROR - Uncaught exception
Traceback (most recent call last):
  File "/Users/Mike/OctoPrint/venv/bin/octoprint", line 8, in <module>
    sys.exit(main())
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/octoprint/__init__.py", line 965, in main
    octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/octoprint/cli/server.py", line 317, in serve_command
    run_server(
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/octoprint/cli/server.py", line 164, in run_server
    octoprint_server.run()
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/octoprint/server/__init__.py", line 371, in run
    self._start_intermediary_server()
  File "/Users/Mike/OctoPrint/venv/lib/python3.9/site-packages/octoprint/server/__init__.py", line 2486, in _start_intermediary_server
    self._intermediary_server.server_bind()
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 48] Address already in use

I am at a loss of what to do next. Any help would be appreciated.

I have been searching for hours and I literally just found the answer 5 minutes after posting. The solution if you are running Monterey is to turn off AirPlay as it listens on ports 5000 and 7000.

Source: Why is Control Center on Monterey … | Apple Developer Forums

2 Likes

You can also specify the --port flag, such as --port 5001 on the octoprint serve command line if you want to run both at the same time.

3 Likes

Do you know how I would do this if I want to load OctoPrint on start? How would I modify the plist file detailed at the start of this thread?

Hello, I just set up OctoPrint up on mymac after some struggle on updating python ect I got it to work, But now I cant seem to get my webcam to work any help here?