Tag: python

Docker django Import Error : No module named 'social'

I am new to Docker+Django development environment. I am facing difficulties in adding python-social-auth into my project. Following is the configurations in workspace: requirement.txt Django==1.9 psycopg2==2.6 python-social-auth==0.2.14 settings.py INSTALLED_APPS = [ . . ‘home’, ‘social.apps.django_app.default’, ] And when trying to run migrate command as follows: docker-compose run web python manage.py migrate getting following error message: […]

Are there any simple python packages that will run a prebuilt docker image

I know there are a ton of articles, blogs, and SO questions about running python applications inside a docker container. But I am looking for information on doing the opposite. I have a distributed application with a lot of independent components, and I have put each of these components inside a docker container(s) that I […]

Run multiple Python scripts in Azure (using Docker?)

I have a Python script that consumes an Azure queue, and I would like to scale this easily inside Azure infrastructure. I’m looking for the easiest solution possible to run the Python script in an environment that is as managed as possible have a centralized way to see the scripts running and their output, and […]

Importing a MySQL database with a Python script fails when the same command works on the command line, what gives?

I’m running a MySQL server in docker container and am trying to import a .sql file in a Python script (Flask app). This is my code: os.system(“docker exec -i %s_db_1 mysql -u<username> -p<password> <db name> < %s” % (name, db_file)) It returns this error in the terminal the Flask app is running in: ERROR 1064 […]

Port binding with a container in docker-py doesn't work

I’m trying to run a container using docker-py and bind ports with the host. I’m afraid I’m not experimented with Docker, but I try many things and I can’t see where my mistake is. My docker API version is 1.22 Here is my code for create the container : from docker import Client cli = […]

Error while running portia on docker in ubuntu

I am getting following error while running portia on docker in ubuntu 14.04. I have gone through following answers, but they are not working. Autobahn websocket issue while running with twistd using tac file docker command: sudo docker run –rm -p 9001:9001 –name portia portia Docker version 1.9.1, build a34a1d5 Twisted: 15.5.0 python – 2.7 […]

Can't import own python module in Postgresql plpython function

I created my own python module and packaged it with distutils. Now I installed it on a new system (python setup.py install) and I’m trying to call it from a plpython3u function, but I get an error saying the module does not exist. It was working on a previous Ubuntu instalation, and I’m not sure […]

Using pytz as non-root in Docker with Alpine Linux causes “IOError: [Errno 13] Permission denied”

I have the following Dockerfile (it’s a bit stripped down, the core elements are displayed here) FROM alpine:latest RUN adduser -D some_user_name &&\ apk add –update alpine-sdk &&\ apk add –update python-dev &&\ apk add –update py-dateutil &&\ apk add –update py-tz USER some_user_name CMD [“/bin/sh”] I then run this image the following way docker […]

docker boto3 AWS was not able to validate the provided access credentials

I’m working in a Command line tool using boto3 in a container running python:3.4 image, In my laptop I can run the code without problem but inside the container I receive the following error: File “/usr/local/lib/python3.4/site-packages/botocore-1.3.26-py3.4.egg/botocore/client.py”, line 310, in _api_call return self._make_api_call(operation_name, kwargs) File “/usr/local/lib/python3.4/site-packages/botocore-1.3.26-py3.4.egg/botocore/client.py”, line 407, in _make_api_call raise ClientError(parsed_response, operation_name) botocore.exceptions.ClientError: An error […]

Error adding local file to docker image with docker-py

I have been working with docker-py, in order to build images and launch containers all in one script. So far it has been very smooth. However, I am currently having issues with the ADD/COPY commands in the Dockerfile string variable. I need to add a file from the source directory directly into the image. With […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.