Today, I encountered an issue on a Synology container where a service plugin triggered an error:

[Plugin / stashdb performer gallery] ModuleNotFoundError: No module named 'stashapi'

If you attempt to troubleshoot and resolve this, follow these steps:

Connect to the container

Assuming you know how to execute commands in the terminal:

docker exec -it <name_or_container_id> /bin/sh

Create a virtual environment:

Inside the container, choose a location for your virtual environment and create it:

python3 -m venv /<path_to_>/venv`

Activate the virtual environment

You need to create and activate the virtual environment:

. <path_to>/venv/bin/activate

Find files containing Python requirements

find / -name requirements.txt

You’ll get results like:

/root/.stash/plugins/community/stashdb-performer-gallery/requirements.txt
/root/.stash/plugins/community/tag_graph/requirements.txt
/root/.stash/plugins/community/date_parser/requirements.txt
/root/.stash/plugins/community/dupeMarker/requirements.txt
/root/.stash/plugins/community/titleFromFilename/requirements.txt
/root/.stash/plugins/community/phashDuplicateTagger/requirements.txt
/root/.stash/plugins/community/TPDBMarkers/requirements.txt
/root/.stash/scrapers/ManyVids/requirements.txt

After this, navigate to the folder containing dependencies.

Install dependencies

For each path, you can run:

pip install -r /path/where/requirements.txt/is/located

After this, the plugin worked successfully for me.

Current Python path:

In the application settings, specify the Python path:

/root/.stash/venv/bin/python3

Alternatively, in the container settings:

PYTHON_PATH=/root/.stash/venv/bin/python3

What’s next

After several container restarts, the virtual environment works correctly. You might need to revisit this path at some point.