【问题标题】:problem using pip to install local package使用 pip 安装本地包的问题
【发布时间】:2018-10-30 14:01:35
【问题描述】:

我对 python 有点陌生,但我需要在 linux 机器上安装一个库,我使用的是 python 2.7。

挑战在于我在防火墙后面并且没有代理来执行实际的pip install confluent-kafka-python

所以我从 github 获得了 confluent-kafka-python.zip,所以我可以离线安装并执行以下操作:

sudo pip install confluent-kafka-python-master.zip

但我收到以下错误:

    Collecting futures (from confluent-kafka==0.11.6)
      Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x1846e90>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/futures/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x1846390>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/futures/
      ....

我该怎么做才能离线安装这个库?

提前致谢

【问题讨论】:

    标签: python python-2.7 pip confluent-platform


    【解决方案1】:

    你必须检查你的包的依赖,在本地下载它们(就像你为 confluent-kafka 做的那样),然后install them with the '--no-index' option

    您可能还想check this page for more on installing local packages

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-14
      • 1970-01-01
      • 2020-02-19
      • 1970-01-01
      • 2017-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多