使用pip安装本地包的问题

problem using pip to install local package

我对 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/
      ....

如何离线安装这个库?

提前致谢

您必须检查包的依赖项,将它们下载到本地(就像您对 confluent-kafka 所做的那样),并且 install them with the '--no-index' option

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