Closed ahmetozmtn closed 1 year ago
Hello,
You didn't create a run.py
file. See https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2#how-to-use
Rebuild it and rename example.pu to run.pySent from my iPhone 13 Pro MaxOn 2 Nov 2022, at 10:36, Ahmet Özmetin @.***> wrote: Hello good day When I build and run the code on docker in windows 11, it gives the following error, how can I fix this error?
docker run twitchbot:experimental Error: python: can't open file 'run.py': [Errno 2] No such file or directory The steps I followed
Download the repo from Github and edit it according to myself (password etc.) docker build -t twitchbot:experimental . build using this code run container with code docker run twitchbot:experimental
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
Rebuild it and rename example.pu to run.py
Don't just rename it, you need to edit it. See my answer above.
I already created that file, still giving error
Show the output of ls
Oh, it's Windows, then dir
, not ls
still giving error
What error? I guess it should be different one now.
If it's the same error, maybe it is related to this remark by @Tkd-Alex from README:
$(pwd) Could not work on Windows (cmd), please use the absolute path instead
I don't really know why it is happening and why it doesn't see the run.py file, since I don't use Docker.
Could someone else please assist with this issue?
@ahmetozmtn It would be nice of you to leave a comment before closing the issue, so it will help other people with the same problem. Did you manage to solve this issue? What was the cause?
Thanks for the help, but I couldn't solve the problem
Let's keep this open, maybe someone else will help.
@ahmetozmtn Try to replace Dockerfile
with https://gist.github.com/rdavydov/5c4c53ca1bd237d6c800f63856a499b1
Docker container is only useful when you already have a cookie file. Docker can only run CLI programs, so it will not start Google Chrome in the non-headless mode.
However, there are workarounds. I think I should experiment with a VNC server in a container, this may be a good cross-plaform approach. More info: https://www.howtogeek.com/devops/how-to-run-gui-applications-in-a-docker-container/
Nevertheless, adding COPY ./run.py ./
to the Dockerfile
should solve @ahmetozmtn 's problem.
Not sure why I got pinged here but
Docker container is only useful when you already have a cookie file. Docker can only run CLI programs, so it will not start Google Chrome in the non-headless mode. However, there are workarounds. I think I should experiment with a VNC server in a container, this may be a good cross-plaform approach. More info: https://www.howtogeek.com/devops/how-to-run-gui-applications-in-a-docker-container/
Selenium has docker images that you can add to a docker-compose/swarm/kubernetes... stack. It also has vnc integrated to it so that you can interact with the browser. From a code point of view it changes nothing, just that instead of creating a ChromeDriver, you create a RemoteDriver.
In the case of my project everything is in docker (just I didn't manage to login as my chrome gets detected for some reason), but the integrity token is queried every so often by connecting to a dockerized chrome instance.
@ahmetozmtn Abort my previous suggestion. The correct solution for Windows lies in the correct command line: docker run --name user2 -v C:\Absolute\Path\To\Twitch-Channel-Points-Miner-v2\run.py:/usr/src/app/run.py:ro -p 5002:5000 rdavidoff/twitch-channel-points-miner-v2
run.py MUST be mounted as a volume (-v).
Everything else is described in https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2#docker
Hello good day When I build and run the code on docker in windows 11, it gives the following error, how can I fix this error?
docker run twitchbot:experimental Error: python: can't open file 'run.py': [Errno 2] No such file or directory
The steps I followed
docker build -t twitchbot:experimental .
build using this coderun container with code
docker run twitchbot:experimental
- OS: Windows 11 - Docker Desktop version 4.13.1 (90346) - Python version 3.8