Installing OctoPrint on FreeBSD fails

I am trying to install OctoPrint on FreeBSD, but it fails.

FreeBSD version:

[gal@klipper ~]$ freebsd-version
14.3-RC1

I created the python virtual environment.

[gal@klipper ~]$ source OctoPrint/bin/activate
(OctoPrint) [gal@klipper ~]$ 

Trying to install OctoPrint with pip, but it fails.

(OctoPrint) [gal@klipper ~]$ pip install OctoPrint
.
.
.
Collecting packaging (from OctoPrint)
  Using cached packaging-24.2-py3-none-any.whl.metadata (3.2 kB)
Collecting annotated-types>=0.6.0 (from pydantic<3,>=2.10.6->OctoPrint)
  Using cached annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)
Collecting pydantic-core==2.33.2 (from pydantic<3,>=2.10.6->OctoPrint)
  Using cached pydantic_core-2.33.2.tar.gz (435 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  Γ— pip subprocess to install build dependencies did not run successfully.
  β”‚ exit code: 1
  ╰─> [45 lines of output]
      Collecting maturin<2,>=1
        Using cached maturin-1.8.7.tar.gz (205 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'error'
        error: subprocess-exited-with-error
      
        Γ— Getting requirements to build wheel did not run successfully.
        β”‚ exit code: 1
        ╰─> [21 lines of output]
            Traceback (most recent call last):
              File "/home/gal/OctoPrint/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
                main()
              File "/home/gal/OctoPrint/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
                json_out['return_val'] = hook(**hook_input['kwargs'])
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/home/gal/OctoPrint/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
                return hook(config_settings)
                       ^^^^^^^^^^^^^^^^^^^^^
              File "/tmp/pip-install-qa95axep/maturin_ff998bba05674f4a9e643b7ad5203bc0/maturin/bootstrap.py", line 29, in get_requires_for_build_wheel
                reqs = _orig_get_requires_for_build_wheel()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/tmp/pip-build-env-x5w8a65b/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
                return self._get_build_requires(config_settings, requirements=[])
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/tmp/pip-build-env-x5w8a65b/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
                self.run_setup()
              File "/tmp/pip-build-env-x5w8a65b/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
                exec(code, locals())
              File "<string>", line 52, in <module>
            ModuleNotFoundError: No module named 'puccinialin'
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: subprocess-exited-with-error
      
      Γ— Getting requirements to build wheel did not run successfully.
      β”‚ exit code: 1
      ╰─> See above for output.
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      
      [notice] A new release of pip is available: 24.0 -> 25.1.1
      [notice] To update, run: pip install --upgrade pip
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— pip subprocess to install build dependencies did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 24.0 -> 25.1.1
[notice] To update, run: pip install --upgrade pip

Hello @galmiklos !
What guide did you use to install OctoPrint?

Maybe OctoPrint deploy will work.

I used the "Installing manually" section at OctoPrint.org - Download & Setup OctoPrint.

I'm not sure if octoprint_deploy will work, it says "Linux", and I am installing on FreeBSD, which is not Linux.

You already tried to install Klipper on that machine, yes?

Now, why would you think that? :wink:

Well, not exactly. I wanted to install Klipper, and Linux on this machine (since Klipper is only supported on Linux, officially), but so far I couldn't install any Linux distribution, only FreeBSD (OpenBSD, too, but I stayed with FreeBSD), and tried running Klipper from source, but it didn't work (Klipper on FreeBSD - #7 by galmiklos - General Discussion - Klipper).

Then I though, I anyway prefer Marlin, so why not try OctoPrint, instead. I read it in a post that FreeBSD is officially supported, although it is not mentioned on the download page anymore, but I wanted to give it a try.

Because of:

Hehe, yes, that's the Klipper post I added the link for, but the question was just a joke. I thought it was the host name of the computer that gave it away. :rofl:

In any case, I suppose the error message is clear in the output.

ModuleNotFoundError: No module named 'puccinialin'

I noticed that early on during my troubleshooting, and indeed, the module had been missing, but I installed it.

(OctoPrint) [gal@klipper ~]$ pip list | grep puccinialin
puccinialin       0.1.5

But I am still getting the error message.

For good measure, I even have the module installed on the system level.

root@klipper:~ # pip list | grep puccinialin
puccinialin       0.1.5

Any help is greatly appreciated.

I ran into a very similar issue and the underlying issue turned out to be that rust was not installed. If you haven't already, try installing the FreeBSD rust package first:

pkg install rust

then try pip installing OctoPrint again. If you're still having an issue, try creating a fresh Python virtual environment for the installation. I also ended up not needing to separately install the puccinialin module, but I don't think having that should hurt.

1 Like

That must be it! I mean, I don't get the error message anymore, and I can see I get past that step, but it looks like my "little computer" is toast. It keeps crashing while installing OctoPrint. There must be some hardware problem with it. It looks like I won't be able to salvage it, after all.

Let me install FreeBSD on another computer (a real one :stuck_out_tongue_winking_eye:), and try it there.

Thank you so much for your advice!

It worked! :slight_smile:

1 Like

It kept bugging me, and so I kept trying. Looks like there may be no problem with the computer, at least not too seriously. What happens is that every time I try to install OctoPrint, the computer crashes at compiling dependencies, more specifically pydantic. There is nothing on the console, the computer just goes dark instantly. There is nothing in /var/log/messages either. This is how "top" looks like at the moment of the crash.

last pid:  2592;  load averages:  4.55,  3.63,  2.04                                                                                                                 up 0+07:56:31  06:00:22
29 processes:  1 running, 28 sleeping
CPU: 99.4% user,  0.0% nice,  0.6% system,  0.0% interrupt,  0.0% idle
Mem: 848M Active, 747M Inact, 915M Wired, 56K Buf, 1303M Free
ARC: 620M Total, 192M MFU, 386M MRU, 944K Anon, 6128K Header, 35M Other
     525M Compressed, 1136M Uncompressed, 2.16:1 Ratio
Swap: 2048M Total, 2048M Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
 2580 gal           6  34    0   352M   254M uwait    1   0:39  99.96% rustc
 2555 gal           6  44    0   564M   408M uwait    1   2:13  99.93% rustc
 2575 gal           6  52    0   482M   371M uwait    3   1:45  99.74% rustc
 2592 gal           6  34    0   463M   312M uwait    1   0:07  99.63% rustc
 2296 root          1  20    0    15M  3672K CPU2     2   0:00   0.06% top
 2159 gal           6  20    0   123M    75M uwait    3   0:02   0.01% cargo
 2094 gal           1  20    0    23M    11M select   2   0:00   0.01% sshd-session
 2100 gal           1  20    0    21M  9216K select   0   0:00   0.00% sudo
 2075 gal           1  20    0   183M   163M piperd   1   0:27   0.00% python3.11
 2146 gal           1  20    0    76M    59M piperd   3   0:03   0.00% python3.11
 2153 gal           1  20    0    60M    43M piperd   2   0:01   0.00% python3.11
 1368 root          1  32    0    14M  2548K nanslp   0   0:00   0.00% cron
 1260 root          1  20    0    14M  2804K select   3   0:00   0.00% syslogd
 2091 root          1  23    0    23M    10M select   2   0:00   0.00% sshd-session
 2059 root          1  20    0    14M  3208K ttyin    1   0:00   0.00% sh
 2072 gal           1  20    0    16M  4740K wait     2   0:00   0.00% bash
 1381 root          1  20    0    14M  2936K wait     3   0:00   0.00% login
 2095 gal           1  24    0    16M  4740K wait     1   0:00   0.00% bash
 1382 root          1  20    0    14M  2976K wait     3   0:00   0.00% login
 2102 root          1  20    0    14M  3320K wait     2   0:00   0.00% sh
 1052 root          1  20    0    15M  4192K select   1   0:00   0.00% devd
 1363 root          1  20    0    23M  9584K select   1   0:00   0.00% sshd
 1386 root          1  68    0    14M  2320K ttyin    2   0:00   0.00% getty
 1383 root          1  68    0    14M  2324K ttyin    2   0:00   0.00% getty
 1387 root          1  68    0    14M  2324K ttyin    0   0:00   0.00% getty
 1388 root          1  68    0    14M  2328K ttyin    3   0:00   0.00% getty
 1384 root          1  68    0    14M  2324K ttyin    1   0:00   0.00% getty
 1385 root          1  68    0    14M  2328K ttyin    3   0:00   0.00% getty
 2101 gal           1  21    0    21M  9208K select   2   0:00   0.00% sudo

And after that, I have to disconnect the CMOS battery to bring the computer back to life.

I think I will try to install FreeBSD on a Raspberry PI, and see how that goes. As I mentioned, it worked on another computer (a Dell OptiPlex 780 with a 4 core i& intel and 8G RAM). Nevertheless, an operating system should not crash from a resource exhaustion. Perhaps I will turn to a FreeBSD forum and bring it up there.

@jtplatt, if you have any insight, as one already having gone through the hoops, I would take any advice.

Thanks again!

Well, I still couldn't find a way to successfully install OctoPrint on my little fanless computer with "pip install OctoPrint", however, I found a way to avoid having to do it.

Remember, I tried installing OctoPrint with "pip install OctoPrint" on another computer (the Optiplex 780) with FreeBSD, and that worked. So, I copied the whole OctoPrint directory over to the fanless computer, and it works! :slight_smile: I get an error message when launching "./OctoPrint/bin/octoprint serve".

2025-06-29 10:30:05,491 - octoprint.environment - ERROR - Error while detecting hardware environment
Traceback (most recent call last):
  File "/home/gal/OctoPrint/lib/python3.11/site-packages/octoprint/environment.py", line 113, in _detect_hardware
    cpu_freq = psutil.cpu_freq()
               ^^^^^^^^^^^^^^^^^
  File "/home/gal/OctoPrint/lib/python3.11/site-packages/psutil/__init__.py", line 1925, in cpu_freq
    ret = _psplatform.cpu_freq()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gal/OctoPrint/lib/python3.11/site-packages/psutil/_psbsd.py", line 362, in cpu_freq
    current, available_freq = cext.cpu_freq(cpu)
                              ^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 112: invalid start byte

But that's understandable. After all, the dependencies were compiled on another hardware, so this would not work. But OctoPrint ignores this error message, and works. :slight_smile: