lorcalhost / BTB-manager-telegram

A feature packed but easy-to-use Telegram bot for remotely managing Binance Trade Bot instances
MIT License
390 stars 155 forks source link

Docker Pip Error #194

Closed macbookator closed 2 years ago

macbookator commented 2 years ago

I tried to build Docker image from Dockerfile from the latest commit and release of BTB-manager-telegram, but I received an error while installing binance-trade-bot's requirements. I don't think this issue about binance-trade-bot, because I can successfully build binance-trade-bot's Dockerfile and older version of BTB-manager-telegram's with the latest binance-trade-bot.

 => ERROR [5/7] RUN pip install --no-cache-dir -r requirements.txt        16.4s
#10 15.96 ERROR: Could not find a version that satisfies the requirement pathlib (from unicorn-binance-websocket-api) (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.97, 1.0, 1.0.1)
#10 15.96 ERROR: No matching distribution found for pathlib
macbookator commented 2 years ago

I found a temporary solution, but it must be fixed on newer versions. When building image, pip can't download pathlib and it gives this error. I fixed it by editing Dockerfile:

FROM python:3.9

WORKDIR ./

RUN /usr/local/bin/python -m pip install 'pathlib>=0.1,<1.0.1'

COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY binance-trade-bot/requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD [ "python", "-m", "btb_manager_telegram", "-p", "./binance-trade-bot/"]
titulebolide commented 2 years ago

Which command did you ran to build the docker image? Did you used run_docker.py?

macbookator commented 2 years ago

I didn't use run_docker.py. I builded only Dockerfile. I used this command on directory: docker build -t binance .

When I changed Dockerfile with the above, it worked. This issue caused because pip can't install pathlib named dependency. I installed it manually inside Dockerfile.

macbookator commented 2 years ago

I tried it again, and it worked now.

requirements.txt of binance-trade-bot tried to download unicorn-binance-websocket-api, and unicorn-binance-websocket-api requires pathlib named dependency. Script tried to download pathlib, but it can't found given version. But version exist. I downloaded pathlib manually before script run, and it worked normally.

So, this issue may be fixed on pathlib's or unicorn-binance-websocket-api's side, and script can now download pathlib without extra commands. This means your script is now working.