PhasecoreX / docker-red-discordbot

The newest Red-Discordbot in a convenient container
GNU General Public License v3.0
290 stars 36 forks source link

Cant load custom cog (with pip `requirement`) #27

Closed tgxn closed 3 years ago

tgxn commented 3 years ago

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? https://github.com/PhasecoreX/docker-red-discordbot/issues/23

tgxn commented 2 years ago

Wow I still have this issue two years later :o

tgxn commented 2 years ago

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
I-question-this commented 1 year ago

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