Tag: python

安装Python 3 Docker Ubuntu错误命令'x86_64-linux-gnu-gcc

我正在尝试创build一个使用Python 3的dockerfile。 FROM ubuntu:14.04 RUN apt-get update RUN apt-get install -y python3 python3-dev python-pip RUN apt-get install -y libxml2-dev libxslt1-dev libpq-dev libjpeg-dev libfreetype6-dev zlib1g-dev RUN cd /var/projects/apps && pip install -r requirements.txt 我得到的错误致命错误:Python.h:没有这样的文件或目录时,试图安装枕头在我的要求,为什么,我是我正确安装python 3? error: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 —————————————- Cleaning up… Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), […]

如何访问在docker上运行的远程django应用程序

我目前正试图通过使用Tutum的AWS服务器上的Docker容器来运行一个django网站。 我已经看过无数的方式通过我的networking浏览器来访问它无济于事。 我得到了我的公有IP, curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//' 并使用几种方法将服务器设置为在端口8000上运行。 python manage.py runserver 0.0.0.0:8000 python manage.py runserver 0:8000 和 ./manage.py runserver 0.0.0.0:8000 ./manage.py runserver 0:8000 然后,当我尝试通过外部IP和端口访问网页时,我得到的网页不可用页面。 我究竟做错了什么? 这只是一个开发服务器,但没有理由,我知道这将允许它被黑客入侵。 谢谢您的帮助!

docker保存文件

我现在有一个docker镜像,可以通过boot2docker访问它。 我在这个上使用Python,安装了所有的库。 我的问题是,我不能在Docker上保存任何文件或图像。 我只是执行一个脚本来保存图像的格式,但没有保存。 我将所有权利授予存储库,并且没有出现任何错误。 我使用cv2.imwrite保存图像。 cv2.imread正在工作。 感谢您的答案!

无法访问使用Docker和Google云部署的应用程序

我目前有一个通过Google云端平台build立的Linux Debian虚拟机。 我已经安装了docker,并希望开始在其中运行应用程序容器。 我正在按照“在Docker中运行Web应用程序”下的Docker网站下的“ find这里 ”下的文档下载图像,并且没有任何问题地运行它。 然后我运行$sudo docker ps并获得0.0.0.0:32768->5000/tcp的端口 然后我尝试浏览到http://“MyExternalVMIP”:32768的网站,但应用程序没有出现。 我错过了什么吗?

在Docker上开发Odoo

我正在尝试使用docker for odoo模块进行开发。 我有以下docker-compose.yml文件 db: image: postgres environment: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo volumes: – data:/var/lib/postgresql/data/ odoo: image: odoo links: – db:db ports: – "127.0.0.1:8069:8069" volumes: – extra-addons:/mnt/extra-addons command: — –update=tutorial 该模块只包含一个__openerp__.py文件,但即使使用–update=tutorial选项,odoo也不会显示我所做的更改 { 'name': "tutorial", 'summary': """Hello world!!""", 'description': """ This is the new description """, 'author': "ybouhjira", 'website': "ybouhjira.com", 'category': 'Technical Settings', 'version': '0.1', 'depends': […]

分配一个docker实例给每个客户端

我有一个Docker实例,将端口A公开给主机。 主机为docker实例预留一个端口B,连接到主机端口B的客户端实际上将在不知道它的情况下与端口A上的docker进行通信。 目前,只有一个客户端可以访问这个docker实例。 我希望能够pipe理多个客户端,每个客户端都有自己的实例。 所以服务器(Python会好的)会接收来自客户端的连接(例如所有客户端的端口5555),并将每个客户端无缝地redirect到自己的docker实例。 这已经存在了,因为它是一个服务器的基本东西,但我似乎缺乏在网上find它的词汇。 这个系统的名称是什么?已经存在了吗?

在Cypher查询中Flask API中断

我在Flask中构build一个与neo4j db交谈的API。 一个特别大的查询(15分钟+)打破了API。 破坏意味着它运行的Docker容器在不logging请求的情况下停止。 麻烦的是,我不能在本地运行API时重现错误。 我想我需要的是一种使用py2neo运行查询的方法,然后返回一个任意的响应而不用等待查询结束。 def post(self): g.cypher.run("MATCH a-[r]-b SET r.cost = " "CASE WHEN r.cost <1 THEN 0.01*exp(4.60517*(r.costx+0.01)) ELSE r.cost END " "SET r.costx = " "CASE WHEN r.costx < 1 THEN r.costx + 0.01 ELSE r.costx END " "RETURN r") return make_response(jsonify({'success': 'all relationship costs increased'}), 200) 我真的不是一个运动员,所以对这个难题的更广泛的见解是最受欢迎的。

在docker中运行pygame

我试图让PyGame在Docker中运行(所以我最终可以在Windows中使用PyGame和TensorFlow)。 但是当我尝试运行时: pip install pygame 我回来了 root@03da78748024:~# pip install pygame Collecting pygame /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Could not find a version that satisfies the requirement pygame (from versions: ) […]

docker boto3 AWS无法validation提供的访问凭证

我在一个命令行工具中使用运行python:3.4图像的容器中的boto3,在我的笔记本电脑中,我可以运行代码没有问题,但在容器内我收到以下错误: 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 occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials 我一直在试图find问题的原因,我发现在Docker时区同步的一个可能的原因,但我试图改变时区,但没有任何成功,这是我的Dockerfile: #Docker container image # Set the base image to use to Ubuntu FROM python:3.4 MAINTAINER […]

Django:从INSTALLED_APPS中删除django.contrib.sites时出错

我想从我的django项目中删除django.contrib.sites 。 当我尝试删除我在启动服务器时遇到以下错误: /usr/local/lib/python3.5/site-packages/django/db/models/fields/subclassing.py:22: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead. web_1 | RemovedInDjango110Warning) web_1 | web_1 | /usr/local/lib/python3.5/site-packages/django/db/models/fields/subclassing.py:22: RemovedInDjango110Warning: SubfieldBase has been deprecated. Use Field.from_db_value instead. web_1 | RemovedInDjango110Warning) web_1 | web_1 | Performing system checks… web_1 | web_1 | System check identified no issues (0 silenced). web_1 | Unhandled exception in thread […]