PhasecoreX / docker-red-discordbot

The newest Red-Discordbot in a convenient container

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cant load custom cog (with pip `requirement`)

tgxn opened this issue · comments

Describe the bug
I am trying to load a local cog (using addpath and load)
My cog is found in the !cogs list, but red does not try to install the "requirements" : ["requests"], from info.json and thus the loading of the cog fails with ModuleNotFoundError: No module named 'requests'

Run command

  rb_bot_red_discord:
    container_name: rb_bot_red_discord
    build:
      context: ./bot-discord
      dockerfile: Dockerfile
    restart: unless-stopped
    volumes:
      - rb_redbot_data:/data
      - ./bot-discord/mycog:/mycog
    environment:
      TOKEN: ${DISCORD_BOT_TOKEN}
      PREFIX: "!"
      EXTRA_ARGS: "--owner ${DISCORD_BOT_OWNER}"

Environment info:
Ubuntu 20.04

Additional context
Under ./bot-discord/mycog I have:
info.json

{
...
    "requirements" : ["requests"],
...
}

along with my plugin's files.

I have also tried to !pipinstall requests but the bot doesn't reply to that command at all? #23

Wow I still have this issue two years later :o

I did this in my Dockerfile

# install additional pip packages
RUN echo "python -m pip install --upgrade --no-cache-dir requests" >> /app/functions/setup-env.sh

@tgxn The pipinstall command is available only after loading the downloader cog (which is a core cog shipped with RedBot).