【问题标题】:Cannot pipenv install confluent-kafka 1.4.0 from source (pypi) - no workaround seems to work无法 pipenv 从源代码(pypi)安装 confluent-kafka 1.4.0 - 似乎没有解决方法
【发布时间】:2020-04-16 12:41:16
【问题描述】:

在 pypi 上似乎有一个 issuecurrent Confluent-Kafka package 一起记录:

我有一个带有以下代码的 Dockerfile,该代码以前可以工作,直到问题发生:

RUN cd /tmp && git clone https://github.com/edenhill/librdkafka.git \
&& cd librdkafka \
&& ./configure --prefix /usr \
&& make \
&& make install \
&& cd .. \
&& rm -rf librdkafka

RUN apk --update add \
......
pip3 install -U setuptools &&\
pip3 install --upgrade pip \
avro-python3\
confluent-kafka[avro]\
confluent-kafka\

ERROR after the issue: Command errored out with exit status 1:
 command: /usr/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = 
 '"'"'/tmp/pip-req-build-14u6lptl/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-
 14u6lptl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)
 (__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, 
 __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-14u6lptl/pip-egg-info
     cwd: /tmp/pip-req-build-14u6lptl/
 Complete output (5 lines):
 Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-req-build-14u6lptl/setup.py", line 12, in <module>
    with open(os.path.join(mod_dir, 'requirements.txt')) as f:
 FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build- 
 14u6lptl/confluent_kafka/requirements.txt'

在该问题的 github 页面上,有一些解决该问题的建议,我已经尝试过这样的:

1) 解决方法不起作用

ENV LIBRDKAFKA_VERSION v1.4.0 \
RUN cd /tmp && git clone https://github.com/edenhill/librdkafka.git \
  && cd librdkafka \
  && git checkout $LIBRDKAFKA_VERSION \
  && ./configure --install-deps --prefix /usr \
  && make \
  && make install 

RUN apk --update add \
......
pip3 install -U setuptools &&\
pip3 install --upgrade pip \
avro-python3\
confluent-kafka[avro]\
confluent-kafka\
....

2) 解决方法不起作用

ENV LIBRDKAFKA_VERSION v1.4.0 \
RUN cd /tmp && git clone https://github.com/edenhill/librdkafka.git \
  && cd librdkafka \
  && git checkout $LIBRDKAFKA_VERSION \
  && ./configure --install-deps --prefix /usr \
  && make \
  && make install

RUN apk --update add \
.....
pip3 install -U setuptools &&\
pip3 install --upgrade pip \
avro-python3\
confluent-kafka[avro]\
--no-binary :all: -i https://test.pypi.org/simple/ confluent-kafka==v1.4.0.1 \
....

ERROR: 
Service 'xxxx' failed to build: The command '/bin/sh -c apk --update add 
avro-python3    
confluent-kafka[avro]    
--no-binary :all: -i https://test.pypi.org/simple/ confluent-kafka==v1.4.0.1 
returned a non-zero code: 1

我想知道是否有一种解决方法,我没有尝试过有人可以建议让我继续,直到他们解决这个问题..

【问题讨论】:

    标签: python pip confluent-platform librdkafka


    【解决方案1】:

    只需固定到旧版本,直到他们发布新版本:

    pip3 install --upgrade pip \
    avro-python3\
    confluent-kafka[avro]==1.3.0\
    

    另外请注意,不需要安装主包(confluent-kafka)和带有附加包(confluent-kafka[avro])的包,您只需要安装带有附加包的包。您实际上是在安装它两次。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-30
      • 1970-01-01
      • 2013-08-15
      • 2014-11-19
      • 1970-01-01
      相关资源
      最近更新 更多