Unable to install Plugins

It would seem I’m unable to install plugins. I’m running Debian and attempted to run the following command: “pip install beets[discogs]”. I then get a “command not found” message.

-bash: pip: command not found
root@Beets:~# pip install "beets[discogs]"
sudo: pip: command not found
root@Beets:~# python3 -m pip --version
/usr/bin/python3: No module named pip

So then I figured I must not have pip installed. So I ran this:

apt install python3-pip

I repeated the same command and get a different error:

root@Beets:~# pip install" beets[discogs]"
ERROR: unknown command "install beets[discogs]"
root@Beets:~# pip install "beets[discogs]"
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

What am I missing?

The quotes are a bit strange there. Did you mean pip install "beets[discogs]"?

I personally use beets in a Docker container. It has this plugin (and many others) installed already.

Yes, that was a typo. I did run pip install "beets[discogs]". Could you share your docker compose for this? I had some trouble using it with docker.

Also, does Beets in a docker container include the Amazon plugin for metadata? Or where do I find a list of the included plugins with beets in docker?

Regardless though, I would like to be able to configure and use external plugins that are not included even with docker.

services:
  beets:
    container_name: beets
    environment:
      PGID: "${PGID}"
      PUID: "${PUID}"
      TZ: "${TZ}"
    hostname: beets
    image: lscr.io/linuxserver/beets
    ports:
      - 8337:8337
    restart: unless-stopped
    volumes:
      - type: bind
        source: ${VOLUME_CONFIG}/beets
        target: /config
        bind:
          create_host_path: true
      - type: bind
        source: ${VOLUME_CONFIG}/custom-cont-init.d/beets
        target: /custom-cont-init.d
        read_only: true
      - type: bind
        source: ${VOLUME_STORAGE}
        target: /storage

PUID, PGID, TZ, VOLUME_CONFIG, and VOLUME_STORAGE are all in my .env file.

My music library is in the /storage volume, so my beets config has /storage/Music as the library location.

The custom-cont-init.d volume is a way to customize Linuxserver containers. You can put scripts in there to be executed when the container starts, so that’s how you could install additional plugins.

The Amazon plugin isn’t a core plugin so it’s not installed by default. I don’t use it because I prefer Musicbrainz as my only metadata source.

About which plugins are already installed in the Docker image maybe look at the Dockerfile they build with. Now that I’m looking at it it looks to me like the only additional plugin is beets-extrafiles so I’m not sure how the Discogs plugin is getting installed since the Dockerfile doesn’t seem to do it, but if I try to pip install "beets[discogs]" inside my container it says it’s already installed.

Thanks, I may try the docker path again and see how it goes. I don’t really understand how to install additional plugins via the custom-cont-init.d script. I guess I’m not familiar enough with Linux yet. Hopefully someone can tell me why I’m encountering an error when attempting to install a plugin.

They’re just shell scripts. Create a directory that you’ll mount to path /custom-cont-init.d inside the container and they’ll get executed when the container starts.

For example, for my beets container I install a couple extra packages, so I have a file named 50-install-packages.sh in a directory that I mount to /custom-cont-init.d inside my container like this:

#!/bin/sh

apk add bash-completion
apk add patch

Your script could be:

/bin/sh

pip install <whatever package you want>

Check the logs of the container when it starts to see if it succeeded, or run a shell in the container to check: docker exec -it beets /bin/bash then run your pip command to see if the package you wanted is installed.