- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
一切都很好?我在使用 docker build 时遇到问题。此应用程序已安装在其他 2 台机器上,但每次都会出现此错误。有谁知道我应该怎么做才能解决它。我有一个 Windows 10,我正在使用 Docker 工具箱。
我在网站上尝试了这个答案,但没有成功:
Python module installation error: command 'gcc' failed with exit status 1
我遵循了 docker 自己网站上的对接教程:
https://docs.docker.com/compose/django/#define-the-project-components
文件
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
RUN pip3 install virtualenv
RUN virtualenv /code
ADD requirements.txt /code/
RUN python -m pip install -r requirements.txt --no-cache-dir
ADD . /code/
PS C:\Users\ThinkPad\Documents\ChatBot> docker build -t backend .
Sending build context to Docker daemon 209.5MB
Step 1/9 : FROM python:3
---> ce54ff8f2af6
Step 2/9 : ENV PYTHONUNBUFFERED 1
---> Using cache
---> 5cefadc9e069
Step 3/9 : RUN mkdir /code
---> Using cache
---> 1dd0287bc4ba
Step 4/9 : WORKDIR /code
---> Using cache
---> 3790083599e1
Step 5/9 : RUN pip3 install virtualenv
---> Using cache
---> ddc61851cc43
Step 6/9 : RUN virtualenv /code
---> Using cache
---> fa9028959057
Step 7/9 : ADD requirements.txt /code/
---> a4b2b341f4f6
Step 8/9 : RUN python -m pip install -r requirements.txt --no-cache-dir
---> Running in fe0b99a3ecf4
Requirement already satisfied: pip==10.0.1 in /usr/local/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (10.0.1)
Collecting amqp==2.2.2 (from -r requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/88/4a/8c45a882d842678963516ebd9cf584a4ded51af719234c3b696c2e884c60/amqp-2.2.2-py2.py3-none-any.whl (48kB)
Collecting billiard==3.5.0.3 (from -r requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/82/55/76f4e786141b7174926cdffa7a155aeea316b729118fb48ec548f3c6754f/billiard-3.5.0.3-py3-none-any.whl (89kB)
Collecting celery==4.1.0 (from -r requirements.txt (line 4))
Downloading https://files.pythonhosted.org/packages/22/9b/88ef5cc7edf5d43215f383ae0a2b1cdeb33f5f07886386c7e4691b2eba0c/celery-4.1.0-py2.py3-none-any.whl (400kB)
Collecting Django==2.0.1 (from -r requirements.txt (line 5))
Downloading https://files.pythonhosted.org/packages/21/2a/3a0ec97b18d6e8d295142228f03604ac78ea6de05cf9bc3773a74f0b58bb/Django-2.0.1-py3-none-any.whl (7.1MB)
Collecting django-cors-headers==2.1.0 (from -r requirements.txt (line 6))
Downloading https://files.pythonhosted.org/packages/10/97/40b519badff93449706cd2cab3f328e1898e627bb218e3429c5581ad1932/django_cors_headers-2.1.0-py2.py3-none-any.whl
Collecting django-notifs==2.6.0 (from -r requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/63/30/8b9b90d3aa47b3b50046eb202727730a6d9ba9b4bc45478ba35466e7662c/django-notifs-2.6.0.tar.gz
Collecting django-templated-mail==1.0.0 (from -r requirements.txt (line 8))
Downloading https://files.pythonhosted.org/packages/24/a8/9619c9a6fbe784c5d9c31283aeb2dd16c1f16902485b7c3f578b39ecd21b/django_templated_mail-1.0.0-py3-none-any.whl
Collecting djangorestframework==3.7.7 (from -r requirements.txt (line 9))
Downloading https://files.pythonhosted.org/packages/7c/0f/70957d583a9040c902b22dfab88323c1be61266eaddb1b3463a401004856/djangorestframework-3.7.7-py2.py3-none-any.whl (1.1MB)
Collecting djangorestframework-jwt==1.11.0 (from -r requirements.txt (line 10))
Downloading https://files.pythonhosted.org/packages/2b/cf/b3932ad3261d6332284152a00c3e3a275a653692d318acc6b2e9cf6a1ce3/djangorestframework_jwt-1.11.0-py2.py3-none-any.whlCollecting djoser==1.1.5 (from -r requirements.txt (line 11))
Downloading https://files.pythonhosted.org/packages/9f/cf/d985a0a453a02c018a68ea69de6c9482bbb345ec85037355601a0023525f/djoser-1.1.5-py3-none-any.whl
Collecting gevent==1.2.2 (from -r requirements.txt (line 12))
Downloading https://files.pythonhosted.org/packages/1b/92/b111f76e54d2be11375b47b213b56687214f258fd9dae703546d30b837be/gevent-1.2.2.tar.gz (3.1MB)
Collecting greenlet==0.4.12 (from -r requirements.txt (line 13))
Downloading https://files.pythonhosted.org/packages/be/76/82af375d98724054b7e273b5d9369346937324f9bcc20980b45b068ef0b0/greenlet-0.4.12.tar.gz (57kB)
Collecting kombu==4.1.0 (from -r requirements.txt (line 14))
Downloading https://files.pythonhosted.org/packages/62/a4/5d16954803224a1e451713293c2a028614099f5538cf626e1fdd7b438c86/kombu-4.1.0-py2.py3-none-any.whl (181kB)
Collecting pika==0.11.2 (from -r requirements.txt (line 15))
Downloading https://files.pythonhosted.org/packages/76/b4/0ada6918ac79ce4d8d45d0ba436ee21a1ef685047fb1dde4d2de0178b327/pika-0.11.2-py2.py3-none-any.whl (107kB)
Collecting PyJWT==1.6.1 (from -r requirements.txt (line 16))
Downloading https://files.pythonhosted.org/packages/31/8f/19c302aa9a391dd1fbd249362b749021b88d40fb59af0363939a2250afed/PyJWT-1.6.1-py2.py3-none-any.whl
Collecting pytz==2017.3 (from -r requirements.txt (line 17))
Downloading https://files.pythonhosted.org/packages/a3/7f/e7d1acbd433b929168a4fb4182a2ff3c33653717195a26c1de099ad1ef29/pytz-2017.3-py2.py3-none-any.whl (511kB)
Collecting simplejson==3.13.2 (from -r requirements.txt (line 18))
Downloading https://files.pythonhosted.org/packages/0d/3f/3a16847fe5c010110a8f54dd8fe7b091b4e22922def374fe1cce9c1cb7e9/simplejson-3.13.2.tar.gz (79kB)
Collecting six==1.11.0 (from -r requirements.txt (line 19))
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting uwsgi==2.0.15 (from -r requirements.txt (line 20))
Downloading https://files.pythonhosted.org/packages/bb/0a/45e5aa80dc135889594bb371c082d20fb7ee7303b174874c996888cc8511/uwsgi-2.0.15.tar.gz (795kB)
Collecting vine==1.1.4 (from -r requirements.txt (line 21))
Downloading https://files.pythonhosted.org/packages/10/50/5b1ebe42843c19f35edb15022ecae339fbec6db5b241a7a13c924dabf2a3/vine-1.1.4-py2.py3-none-any.whl
Collecting psycopg2-binary==2.7.4 (from -r requirements.txt (line 22))
Downloading https://files.pythonhosted.org/packages/77/09/4991fcd9a8f4bea1ee3948e1729fa17c184d25bd10809bacc143626361b9/psycopg2-binary-2.7.4.tar.gz (426kB)
Collecting ptvsd==3.2.1 (from -r requirements.txt (line 23))
Downloading https://files.pythonhosted.org/packages/37/44/6dedb2ef160c72c46c4575885bb9d2d6c464202915c14312d02fad0b9c70/ptvsd-3.2.1-py2.py3-none-any.whl (59kB)
Installing collected packages: vine, amqp, billiard, pytz, kombu, celery, Django, django-cors-headers, pika, six, django-notifs, django-templated-mail, djangorestframework, PyJWT, djangorestframework-jwt, djoser, greenlet, gevent, simplejson, uwsgi, psycopg2-binary, ptvsd
Running setup.py install for django-notifs: started
Running setup.py install for django-notifs: finished with status 'done'
Running setup.py install for greenlet: started
Running setup.py install for greenlet: finished with status 'error'
Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-g5y1o81k/greenlet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-mz7pfy5s/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'greenlet' extension
creating build
creating build/temp.linux-x86_64-3.7
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.7m -c greenlet.c -o build/temp.linux-x86_64-3.7/greenlet.o
greenlet.c: In function ‘g_switchstack’:
greenlet.c:463:29: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
current->exc_type = tstate->exc_type;
^~
greenlet.c:464:30: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
current->exc_value = tstate->exc_value;
^~
greenlet.c:465:34: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
current->exc_traceback = tstate->exc_traceback;
^~
greenlet.c:485:9: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
tstate->exc_type = target->exc_type;
^~
greenlet.c:487:9: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
tstate->exc_value = target->exc_value;
^~
greenlet.c:489:9: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
tstate->exc_traceback = target->exc_traceback;
^~
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-g5y1o81k/greenlet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-mz7pfy5s/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-g5y1o81k/greenlet/
The command '/bin/sh -c python -m pip install -r requirements.txt --no-cache-dir' returned a non-zero code: 1
最佳答案
尽管 ClumsyPuffin 的解决方案运行良好,但它使用了更重的分布。
在安装要求之前,我只是通过在 Dockerfile 中添加以下行来解决这个问题。RUN apk add build-base
build-base is a meta-package that will install the GCC, libc-dev andbinutils packages (amongst others).https://wiki.alpinelinux.org/wiki/GCC
关于django - 错误greenlet docker build,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51255945/
我正在运行一个可以在这里找到的模块:https://github.com/danieliu/play-scraper 我在python文件中的代码如下: 导入 play_scraper print(p
这是什么意思?我该如何解决? gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/j
可以requests库 session 对象可以在 gevented 程序中安全地跨 greenlets 使用吗? 编辑 - 添加更多说明: 当一个 greenlet 因调用套接字向服务器发送请求而屈
我使用的是 Windows 10,我从源代码安装 Odoo ( https://github.com/odoo/odoo/tree/aa0554d224337e1d966479a351a3ed059d
greenlet包被 gevent 和 eventlet 用于异步 IO。它是作为 C 扩展编写的,因此不适用于 Jython 或 IronPython。如果不关心性能,那么在纯 Python 中实现
我正在寻找一种通过另一个函数传递函数参数的方法,其方式与 Stackless 的 tasklet 实例化相同: stackless.tasklet(function_being_called)(*ar
我知道阻塞代码对于事件循环(即 NodeJS)来说是一种罪过,但是对于 greenlets(我认为是绿色线程)呢?运行调用阻塞函数的代码是否有问题? 最佳答案 没有 gevent 提供的事件循环的 G
我将 bottle & gevent 用于我的 python (2.7.6) 应用程序。 # -*- coding: utf-8 -*- from __future__ import unicode_
假设我有一个 Event() 进来,并且有 X 个 greenlets 在等待这个事件。当那些等待的 greenlets 完成后,我想做一个 Publish() 我怎么知道什么时候发布? 原理图: e
我对 greenlets 和 gevent 还是个新手,但据我了解,greenlets 会在显式 yield 语句或阻塞 I/O 操作时屈服于其他 greenlets。但是使用 print 语句阻塞写
我正在尝试实现一个简单的 gevent 设置。有一个发件人应该并行向多个服务员发送一个值。 Event 类最接近解决此问题,如下所示。 每三秒,setter 创建一个事件,解除对所有等待者的阻塞。事件
我希望为 gevent greenlet 分配自定义名称/标识符。 Gevent 已经分配了一个唯一的名称: def name(self): """ The greenlet name
我想编写一个程序,其中有几个永远运行的相互调度的函数。我想到使用 gevent 来达到这个目的。他们对长期运行的 greenlet 有什么问题吗? 我正在编写这种格式的程序 from gevent.p
我正在 try catch greenlet 中引发的异常。根据this tutorial ,不幸的是“在 Greenlet 中引发异常,留在 Greenlet 中”。在下面的代码中,我有一个生成爬行
在使用 gevent 时,每当子 greenlet 抛出异常时,我希望它冒泡到父级(理想情况下让父级抛出异常)。在 greenlets 的文档中,它说这是自动完成的,但在 gevent 中似乎并非如此
我正在搜索如何在一个程序中的 gevent 和其他 greenlet 中运行服务器。所以我想要服务器(多个连接)和一个或两个其他 greenlets。这可能吗?如果是,那么如何? 最好的问候,马特。
我正在使用 gevent 下载一些 html 页面。有些网站速度太慢,有些网站会在一段时间后停止服务请求。这就是为什么我必须限制我提出的一组请求的总时间。为此,我使用 gevent“Timeout”。
当我尝试使用 kill() 杀死一个 greenlet 时,'block' 参数默认为 True, Greenlet.kill(self, exception, block, timeout) 文档说
当我使用标准的 logging 包从 greenlets 中打印出日志语句时,我得到的文本如下所示: 2014-02-06 22:38:43,428 [INFO] (11396-Dummy-2) ev
我是异步编程新手。我正在做一个小型 POC,我想了解 greenlets 与共享对象的行为方式。我写了这段代码 - from gevent import monkey, sleep from geve
我是一名优秀的程序员,十分优秀!