Tag: python 3.5

在Ubuntu 16.04上安装conductr-cli时出错

我通过控制台安装导游时遇到了这个错误。 Downloading pyreadline-2.1.zip (109kB) Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-hq5o2_4a/pyreadline/setup.py", line 21, in <module> exec(compile(open('pyreadline/release.py').read(), 'pyreadline/release.py', 'exec')) File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1503: ordinal not in range(128)

Python中的逻辑错误'if'评估

我刚刚发生了最奇怪的错误。 我没有机会完全debugging它,但我想发布这个,看看是否有其他人有类似的问题。 问题 下面的代码是在一个函数下载一个文件。 if最终文件存在, if语句逻辑将跳过下载步骤。 log.debug('force: {}, isfile: {}'.format(force, os.path.isfile(fasta_path))) log.debug('if result: {}'.format(force or not os.path.isfile(fasta_path))) if force or not os.path.isfile(fasta_path): # we don't have the file, so download it log.info('Downloading reference FASTA') else: log.info('FASTA found–skipping download.') 运行时,打印出下列内容: [17-02-14 05:03:32 – __main__:119 – DEBUG] force: False, isfile: True [17-02-14 05:03:32 – __main__:120 – DEBUG] […]

用python 3.5安装cPickle

这可能是愚蠢的,但我无法安装python 3.5泊坞窗的cPickle图像 Dockerfile FROM python:3.5-onbuild requirements.txt cpickle 当我尝试build立图像 $ docker build -t sample . Sending build context to Docker daemon 3.072 kB Step 1 : FROM python:3.5-onbuild # Executing 3 build triggers… Step 1 : COPY requirements.txt /usr/src/app/ Step 1 : RUN pip install –no-cache-dir -r requirements.txt —> Running in 016c35a032ee Collecting cpickle (from -r […]

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() […]