Category : python-3.x

I am trying to use connexion/Flask to return a base64-encoded image generated by PIL/pillow in a HTTP Response. Having upgraded to python3.7 from python2.7, that part of the code works unaltered. However, when running inside Docker (python3.7-slim), I get the time-honoured TypeError: Object of type bytes is not JSON serializable (full Traceback below). The encoding ..

Read more

I have a simple python script that runs a sql query and converts the query results into csv (and parquet) leveraging pandas.to_csv(path/to/csv-file) (and pandas.to_parquet(path/to/parquet-file) The Dcokerfile is as following: FROM ubuntu:latest RUN apt-get update RUN apt-get install -y build-essential python3.8 python3-pip python3-dev cron vim busybox WORKDIR /app RUN pip3 -q install pip –upgrade COPY requirements.txt ..

Read more

mysql in docker on windows with python, local LOAD DATA INFILE… query gets the pymysql 1290 error, ‘The MySQL server is running with the –secure-file-priv option so it cannot execute this statement’ mysql> SHOW VARIABLES LIKE ‘secure_file_priv’; in powershell shows ‘NULL’ tried LOAD DATA LOCAL INFILE… as found as possible solution get pymysql error 3948, ..

Read more

I am trying to cross compile python (3.9.7) code that uses scapy package. I am using dockers buildx functionality to virtualize aarch64 architecture. The target device is using a linux kernel 4.5.1 but I am not super sure that matters. Once I have that virtualized environment I then run pyinstaller to create a single executable ..

Read more

Env file: AWS_ACCESS_KEY_ID=AAAAAAAAAAAAAAAAAA AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx AWS_DEFAULT_REGION=eu-west-1 AWS_DEFAULT_OUTPUT=json Config file: [profile a] credential_source = Environment region=eu-west-1 role_arn=arn [profile b] credential_source = Environment region=eu-west-1 role_arn=arn [profile c] credential_source = Environment region=eu-west-1 role_arn=arn Dockerfile content: FROM apache/airflow:2.1.2-python3.8 ARG AIRFLOW_USER_HOME=/opt/airflow ENV PYTHONPATH "${PYTHONPATH}:/" RUN pip install -r requirements.pip ADD ./my_path/aws/config /home/airflow/.aws/config Volume in compose: – ./my_path/aws:/home/airflow/.aws If I run: docker ..

Read more

When ran the ./dcoker-compose.sh command in the power shell, got the following error: Deploying Eclipse Kapua… Traceback (most recent call last): File "dockerapiclient.py", line 214, in _retrieve_server_version File "dockerapidaemon.py", line 181, in version File "dockerutilsdecorators.py", line 46, in inner File "dockerapiclient.py", line 237, in _get File "requestssessions.py", line 543, in get File "requestssessions.py", line 530, ..

Read more

I am running an arsenic (Firefox + Geckodriver) script in a Docker container. I am trying to control log levels in the Browser like this: from arsenic import browsers browser = browsers.Firefox( **{‘moz:firefoxOptions’: { ‘args’: [‘-headless’], ‘binary’: ‘/usr/bin/firefox’}, ‘log’: {‘level’: ‘warning’} } ) However, when I try running it, I get: ERROR:asyncio:Unclosed client session client_session: ..

Read more