To preface I’m fairly new to Docker, Airflow & Stackoverflow. I’ve got an instance of Airflow running in Docker on an Ubuntu (20.04.3) VM. I’m trying to get Openpyxl installed on build in order to use it as the engine for pd.read_excel. Here’s the Dockerfile with the install command: The requirements.txt file looks like this: And the docker-compose.yaml file looks
Tag: docker
ModuleNotFoundError: No module named ‘app’ fastapi docker
when i used docker-compose up -d ModuleNotFoundError: No module named ‘app’ the folders in Fastapi framework: fastapi app -main.py Dockerfile docker-compose Answer Your work directory is /app and the main.py file is already there. So you don’t need to call app.main module. Just call main.py script directly in CMD.
Download files without dialog window selenium
I have a cod. I have a docker + python + pytest + selenium + Chrome + selenium host and prefs But it doesn’t work. I want save to file without dialog window. But test don`t save files. How can I understand the reason? And… Downloading files works on Windows, but not docker on linux. P.S I have this path
How to pass a variable into an Pyspark sequence to generate time series?
I want to generate a time series, from 2021-12-01 to 2021-12-31, but I want to pass the values with variables into de function secuence. This is my code: I want the values 2021-12-01 and 2021-12-31 inside variables. Something like: And get this result: But instead I’m reciving: cannot resolve ‘eldia1’ given input columns: [MES, NEGOCIO]; Answer Easiest would be to
How to add Python and pip or conda packages to DDEV
I need to execute a Python script inside the Ddev web docker image, but am having trouble figuring out what Debian python libraries are required to get Python binary with additional py package dependencies working. Answer Python 2 on DDEV You really don’t want to be using Python 2 do you? (See caveats 1 & 2 below) Add the following
flask app not running automatically from Dockerfile
My simple flask app is not automatically starting when I run in docker, though I have added CMD command correctly. I am able to run flask using python3 /app/app.py manually from container shell. Hence, no issue with code or command I run docker container as When I log in to docker container and run “ps -eaf” on Ubuntu shell of
What is the best way to work with whitelisted IP’s on a MySQL DB when using Docker?
I have a server which contains a python file that connects to two external MySQL DB’s. One of those DB’s can be easily reached while the other server requires that IP’s be whitelisted in order to have access to that DB. That server’s IP is already whitelisted and works as intended when ran. The problem arises however when I attempt
Why TensorFlow CPU 2.7.0 is not found by docker while creating an image?
I am building a docker image, using this Dockerfile: This is the command I used: And it is giving this error: Why it can’t find tensorflow-cpu==2.7.0, when this TensorFlow version is available. What’s wrong? Here is my requirements.txt: What is not working: Just writing tensorflow in requirements.txt is also not working. Removing tensorflow from requirements.txt and adding this RUN python3.8
ADD multiple Files to a docker but just RUN one of them
It’s just a theoretical question. Is there a way to run the docker but only run one specific script without changing the Dockerfile? Maybe with the docker run [container] command? Dockerfile: Theoretical Command: docker run docker-test main2.py Answer There is nothing “theoretical” about this. Docker copies into place the files, and if they are working executables, you can execute them
Copy and install packages within tox and set environment variables like you would in a Dockerfile
In my Dockerfile I have this: Can I do the same in tox? I know you can run commands by specifying in tox.ini as follows: But I just don’t know if all the commands that would work in a Dockerfile would work in tox as well. Answer So I’ve tried it and it worked. To try implement the above, this