Defxult/reactionmenu

pip install fails when deploying via Docker

Closed this issue · 1 comments

Describe the bug
Hey, I'm trying to deploy my bot via Docker and have listed reactionmenu in my requirements.txt. discord.py is listed above reactionmenu in the order. I'm not 100% sure this is a reactionmenu issue, but I noticed that it's running a setup where it tries to import discord which - going by the error ModuleNotFoundError: No module named 'discord' - it considers not technically installed yet (see full error below).

To Reproduce
Minimal code to reproduce the bug/error
My Dockerfile:

FROM python:3.10
WORKDIR /Legion
COPY requirements.txt /Legion
RUN pip install -r requirements.txt
COPY . /Legion
CMD python Bot.py

Installation succeeds if I take reactionmenu out of my requirements.txt and install it separately:

FROM python:3.10
WORKDIR /Legion
COPY requirements.txt /Legion
RUN pip install -r requirements.txt
RUN pip install reactionmenu
COPY . /Legion
CMD python Bot.py

Traceback if any

#7 5.329 Collecting reactionmenu
#7 5.342   Downloading reactionmenu-3.1.1.tar.gz (74 kB)
#7 5.348      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.7/74.7 kB 28.4 MB/s eta 0:00:00
#7 5.358   Preparing metadata (setup.py): started
#7 5.928   Preparing metadata (setup.py): finished with status 'error'
#7 5.934   error: subprocess-exited-with-error
#7 5.934   
#7 5.934   × python setup.py egg_info did not run successfully.
#7 5.934   │ exit code: 1
#7 5.934   ╰─> [10 lines of output]
#7 5.934       Traceback (most recent call last):
#7 5.934         File "<string>", line 2, in <module>
#7 5.934         File "<pip-setuptools-caller>", line 34, in <module>
#7 5.934         File "/tmp/pip-install-nxkdkchh/reactionmenu_30295bb936e143ea8e135fbca65ce21f/setup.py", line 3, in <module>
#7 5.934           from reactionmenu import __source__
#7 5.934         File "/tmp/pip-install-nxkdkchh/reactionmenu_30295bb936e143ea8e135fbca65ce21f/reactionmenu/__init__.py", line 12, in <module>
#7 5.934           from .buttons import ReactionButton, ViewButton
#7 5.934         File "/tmp/pip-install-nxkdkchh/reactionmenu_30295bb936e143ea8e135fbca65ce21f/reactionmenu/buttons.py", line 48, in <module>
#7 5.934           import discord
#7 5.934       ModuleNotFoundError: No module named 'discord'
#7 5.934       [end of output]
#7 5.934   
#7 5.934   note: This error originates from a subprocess, and is likely not a problem with pip.
#7 5.936 error: metadata-generation-failed
#7 5.936 
#7 5.936 × Encountered error while generating package metadata.
#7 5.936 ╰─> See above for output.
#7 5.936 
#7 5.936 note: This is an issue with the package mentioned above, not pip.
#7 5.936 hint: See above for details.
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1

Required Checklist

  • I am using discord.py 2.0 or higher
  • I am using reactionmenu 3.1.0 or higher
  • I have the required intents enabled

Version Info
What version of reactionmenu/discord.py are you using?

  • reactionmenu: 3.1.0
  • discord.py: 2.0.1

Refer to my most recent comment on a similar issue here: #42 (comment)

Thanks!