Tag: python 3.x

docker上的Matplotlibbuild设

我有一个Python的应用程序,我想创build一个泊坞窗图像。 该应用程序在我的电脑上正常工作,但是当我创build一个泊坞窗图像时,我得到这个警告: UserWarning:Matplotlib正在使用fc-list构build字体caching。 这可能需要一些时间。 warnings.warn('Matplotlib正在使用fc-list构build字体caching,这可能需要一些时间。') 之后,我稍等一下,程序崩溃,因为有一个float division by zero 。 这从来没有发生在个人电脑上。 当在我的电脑上testing时,我有一个环境激活,我只是点击pip freeze > requirements.txt所以我知道一切都被导入。 我正在使用matplotlib 1.5.3 。 我已经看到了删除~/.cache/matplotlib/fontList.cache和~/.matplotlib的解决scheme,但我不能这样做到一个泊坞窗图像。 有没有人有什么build议? 我有一个Dockfile ,在它旁边有一个我的程序文件夹(和其他一些我需要的文件),我用hello.py启动程序。 从hello.py我开始使用matplotlib的子hello.py 。 Dockfile: FROM continuumio/anaconda:4.2.0 MAINTAINER Milos Radosavljevic "kemis93@gmail.com" RUN apt-get install -y build-essential libblas-dev liblapack-dev RUN pip install –upgrade pip WORKDIR /charts COPY charts/requirements.txt charts/ RUN pip install -r charts/requirements.txt COPY charts […]

在默认的Tensorflow docker容器中更新Jupyter到Python 3.4

我正在使用gcr.io /tensorflow/tensorflow泊坞窗图像,并需要在容器内更新jupyter到python版本3.4。 我试过在网上search,但还没有真正find如何做到这一点。 有人能帮我解释一步一步吗?

在构buildDocker容器时python3中的Mysterious UnicodeDecodeError

我正在创build一个python 3应用程序。 https://github.com/Omrigan/TED-analysis 部署我想要在我的Github仓库的根目录中使用Docker和Dockerfile(你可以检查它)。 所以,当我做“dockerbuild造”。 我在这行上得到一个错误: RUN pip3 install –upgrade -r /root/ted_talks/requirements.txt 从控制台login: Collecting httpretty==0.8.10 (from smart-open>=1.2.1->gensim->-r /root/ted_talks/requirements.txt (line 4)) Downloading httpretty-0.8.10.tar.gz (41kB) Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-em459e9u/httpretty/setup.py", line 86, in <module> version=read_version(), File "/tmp/pip-build-em459e9u/httpretty/setup.py", line 46, in read_version finder.visit(ast.parse(local_file('httpretty', […]

为什么docker工人正在寻找/简单的Python包?

我一直试图让Django通过docker容器中的uwsgi运行。 我有Django运行在docker,其内置的Web服务器,但现在我已经修改requirements.txt包括uwsgi,我不断收到以下错误信息: )连接断开连接后,重试(重试(总= 4,连接=无,读取=无,redirect=无)))NewConnectionError(':无法build立新的连接:[Errno -2] Name or service not known' ':/ simple / uwsgi / 所以看起来像docker使用的PIP包是/simple ,但是这是如何改变? 当我第一次创build容器Django和psycopg得到下载罚款。 我试着指定uwsgi包的完整URL,但是这也不起作用。 泊坞窗,compose.yaml: version: '3' services: db: image: postgres web: dns: 8.8.8.8 build: . command: uwsgi –http :8000 –module destExp.wsgi volumes: – .:/code ports: – "8000:8000" depends_on: – db Dockerfile: FROM python:3.5 ENV PYTHONUNBUFFERED 1 RUN mkdir /code […]

在Docker托pipe的应用程序上运行“使用cython进行debugging器加速”

我有一个奇怪的问题,我似乎无法深究。 我的django项目是使用docker-composebuild立的 version: '2' services: db: image: postgres:9.6.0 environment: POSTGRES_PASSWORD: docker POSTGRES_USER: docker ports: – "8001:5432" djweb: build: . command: python dj/manage.py runserver 0.0.0.0:8000 volumes: – .:/code ports: – "8000:8000" depends_on: – db 和dockerfile是 FROM python:3.5.2 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/ […]

是否有可能在PyCharm CE中使用Docker?

我必须debuggingpython项目。 PyCharm IDE看起来不错(我下载了Community Edition,因为它是免费的)。 但主要脚本是从Docker“叫”(我不太熟悉它)。 我发现所有的来源都说Docker可以作为Remote Interpreter来添加。 PyCharm CE有一些限制 ,所以在这个IDE中添加“Remote Interpreter”是不可能的。 你知道一些解决方法吗? 也许PyCharm可以连接到“某些东西”(一些非官方的项目),而“东西”使用Docker? 或者也许有另一个好的IDE有这样的可能性? (我不想在命令行中debugging)。 提前致谢。

asyncio客户端服务器在docker中不起作用

我有客户端和服务器(通过HTTP发送json消息)在我的标准Ubuntu的16.04工作正常 但后来我试图运行它的客户端和服务器内泊坞窗或客户端外的docker和服务器里面我有错误。 我的docker命令: sudodocker运行-p 127.0.0.1:8888:8888 -i -t seo_server 这是我的服务器和客户端代码和错误: 服务器 import asyncio import json import aiohttp import re async def get_cy(domain): return {'result': 'ok','value':10} async def handle(reader, writer): # data = await reader.read(1000) data = bytearray() while not reader.at_eof(): chunk = await reader.read(2 ** 12) data += chunk # print(json.loads(data)) # https://aiomas.readthedocs.io/en/latest/ message = data.decode() […]

Docker容器是否共享一个Python GIL?

当我在一个Docker容器中运行一个Python脚本时,它会在1分钟内完成一个执行循环。 现在,当我从相同的图像中旋转了2个以上的容器,并在里面运行Python脚本时,一切都变慢了,并且每循环开始需要5-6分钟。 没有脚本是资源绑定的; 有大量的RAM和CPU内核闲置。 在64核Xeon Phi系统上运行3个容器时会发生这种情况。 那么Doc​​ker在所有容器中共享一个通用的Python GIL锁吗? 我有什么select来分离GIL,所以每个过程将以全速运行? 谢谢!