Could not import OctoPrint's setuptools, are you sure you are running under the correct Python environment?

What is the problem?

What does this mean? why would there be more than one python environment on a raspberry π device?

What did you already try to solve it?

Tried installing using pip, creating a venv, installing python from source, only to learn that I had done so but the symlink still pointed to the old version (3.9)

Have you tried running in safe mode?

no

Did running in safe mode solve the problem?

WRITE HERE

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)

WRITE HERE

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
octoprint-systeminfo-20251018204632.zip (64.4 KB)

What I would like to see is a reliable way to install plugins. Either thru the UI/plugin manager or using pip. I don't know why I need a virtual environment when octoprint is the only process/application on this device. It's a raspberry π, not a laptop or general purpose desktop computer. I was going to install and run optolapse on a 44 hour job that would make a fun video but since the recent upgrade I can't reliably install plugins that are part of the octoprint's USP.

OctoPrint is a Python application and will run on any host that can run Python with the Raspberry Pi being one of those hosts. The laptop or the general purpose desktop you mention could potentially run OctoPrint. Many Python applications are designed to run in a virtual environment and this includes OctoPrint.

A properly configured OctoPrint has a reliable way to install plugins along with a very robust plugin library. This includes a reliable update system for both OctoPrint and its plugins.

The bundle you provided (Thank You!) shows that the OctoPi version is rather old (2023) and since the current installation has quite a few errors, my recommendation would be to start over on a new microSD card with the current version of OctoPi (stable). It looks like you only have two plugins (see below) so I don't believe you need to make a backup, but you can if you wish. Keeping the old microSD card will allow migrating any files you may have added that are not part of the actual OctoPrint environment.

| Third Party Plugins (2)
|   Bed Visualizer (1.1.2) = /home/paul/oprint/lib/python3.11/site-packages/octoprint_bedlevelvisualizer
|   Camera Settings (0.4.3) = /home/paul/oprint/lib/python3.11/site-packages/octoprint_CameraSettings

Interesting that it's considered rather old since I seem to recall going through an update process a few weeks ago as well as a python upgrade I don't have a lot of confidence in. I realized during all this that it was still using the old version (3.9) when 3.11 was installed. I adjusted the symlink but the OctoLapse plugin still kicks out errors.

According to the UI, I have OctoPrint Version 1.11.3 which is listed as the current version on the download page. See also…

OctoPrint version : 1.11.3
OctoPi version    : 1.0.0

cat /etc/octopi_version
1.0.0

I'd just as soon fix the errors as start over. Since the version numbers seem current, I should be close to a sane install…the parts are there, evidently, or those version numbers would not be. For an installation where octopi/print are the only things running, a virtual environment seems to add a layer of complication. Is there no way to just have a dedicated setup?

You are correct that the OctoPrint version is up to date. Your OctoPi (which is the customized Raspberry Pi OS) version is 1.0.0 and was flashed from an image created on October 9, 2023 (see below). The Python version in that OctoPi image was 3.9.2. Since you have Python 3.11.9 it has been updated since the image was originally flashed. If you have been doing apt update and apt upgrade as well, then the operating system and support files are also more up to date.

env.plugins.pi_support.octopi_version: 1.0.0
env.plugins.pi_support.octopiuptodate_build: 1.0.0-1.9.3-20231009151442
env.plugins.pi_support.octopiuptodate_build_short: 2023.10.09.151442
octoprint.version: 1.11.3
env.python.version: 3.11.9

While fixing the errors is possible, it will be more work than "starting over" which will have the added advantage that you will also get a more up to date version of the operating system. OctoPi 1.0.0 is based on Debian 11 (bullseye). OctoPi 1.1.0 is based on Debian 12 (bookworm).

Running OctoPrint outside of a virtual environment is probably doable but you will be "on your own" for support as I believe all the people that frequently help out in this forum do not do so.

If you still want to attempt to fix your current system, then I'm afraid that is beyond my expertise level.

Well, there is a multi-day job running at the moment so I won't be doing anything to it at present. I may have run apt-update/upgrade at some point but I am not a Debian user so am not familiar with that.

I suppose there may be a manual that explains how to keep a system up to date without a complete re-flash? Not what I am used with other FOSS environments.

I'll see what can be done once this job is complete. I may have a spare SD card I can prepare in the event I have to start over from scratch.

so in the interest of completeness, here is some of what I have done to figure this out.

I created virtual environment in python3.11 and activated it, then tried installing the plugin through pip and by running the setup.py in its directory.

The one I created is called installer. I have tried using the one in octoprint but it didn't work. That may have been before I dealt with the errant symlink. The one in oprint was last accessed on 10/1/2025.

./octoprint/bin/activate
./oprint/bin/activate
./installer/bin/activate

File: ./octoprint/bin/activate
  Size: 1699      	Blocks: 8          IO Block: 4096   regular file
Device: b302h/45826d	Inode: 64158       Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/    paul)   Gid: ( 1000/    paul)
Access: 2025-10-18 20:32:01.618377444 -0700

I think what I am looking for is how the venv can access the setup tools, to more clearly restate the original question. I have a hard time imagining this is impossible, either through outright copying them into place or using a symlink/path directive.

Your issue with installing OctoLapse is a known problem. You just need to copy/paste the release URL below into plugin manager > get more > ...from URL.

https://github.com/FormerLurker/Octolapse/archive/refs/tags/v0.4.5.zip

I thought I tried that? I'll take another look when this job completes.

That worked, sort of. The installer has stalled after displaying this message:

Building wheel for Octolapse (setup.py): started
DEPRECATION: Building 'Octolapse' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'Octolapse'. Discussion can be found at https://github.com/pypa/pip/issues/6334

I'll check back later today and see if it finishes. Perhaps making those changes will resolve it.

and it finished while I was adding that comment.

Sadly, it didn't install. I can't find it in the plugin manager UI.

The process completed, or so it said, but nothing was installed. Installing from source might work if I knew how.

Neither of the two zip files — https://github.com/jneilliii/Octolapse/archive/refs/heads/master.zip and https://github.com/user-attachments/files/21278031/build_2025_06_19.zip — mentioned above worked properly. They installed but as plugin with no name which makes it hard to access. Not even sure I remember where in the UI OctoLapse is.

If I remember correctly it has it's own tab and a section in the settings.