#πŸ”’ A little confusion while using Python in Docker

8 messages Β· Page 1 of 1 (latest)

sick warren
#

I'm using Github project GPT4Free in docker, and sth. strange happened to me (included in the img)
The only difference between two cmds is there's a -v param in the 1st one. I dont know why, and plz help.

normal lindenBOT
#

@sick warren

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

vale steeple
#

Is that how the container is supposed to be run? Could you provide links to repo/docs?

With first command, you link the /var/g4f in the host computer to the /app in the container (overwriting the original /app in the image). It seems it probably tries to import g4f.cli stuff but you haven't installed it...?
Vs original /app that doesn't try to import it.

So it all depends on what the docs say about how to run it - whether you're linking correct file(s) to correct place, etc

sick warren
sick warren
vale steeple
# sick warren https://github.com/xtekky/gpt4free

The commands in readme clearly show that -v is supposed to use /app/some_directory, not just /app

docker run \
  -p 8080:8080 -p 1337:1337 -p 7900:7900 \
  --shm-size="2g" \
  -v ${PWD}/har_and_cookies:/app/har_and_cookies \
  -v ${PWD}/generated_images:/app/generated_images \
  hlohaus789/g4f:latest

So as I said, you were overwriting real /app with code and that's why it kept failing importing g4f.cli

normal lindenBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.