python开发的软件必须提供源码_在没有互联网的情况下安装python软件包,并将源代码用作.tar.gz和.whl...

we are trying to install couple of python packages without internet.

For ex : python-keystoneclient

For that we have the packages downloaded from https://pypi.python.org/pypi/python-keystoneclient/1.7.1 and kept it in server.

However, while installing tar.gz and .whl packages , the installation is looking for dependent packages to be installed first. Since there is no internet connection in the server, it is getting failed.

For ex : For python-keystoneclient we have the following dependent packages

stevedore (>=1.5.0)

six (>=1.9.0)

requests (>=2.5.2)

PrettyTable (<0.8,>=0.7)

oslo.utils (>=2.0.0)

oslo.serialization (>=1.4.0)

oslo.i18n (>=1.5.0)

oslo.config (>=2.3.0)

netaddr (!=0.7.16,>=0.7.12)

debtcollector (>=0.3.0)

iso8601 (>=0.1.9)

Babel (>=1.3)

argparse

pbr (<2.0,>=1.6)

When i try to install packages one by one from the above list, once again its looking for nested dependency .

Is there any way we could list ALL the dependent packages for installing a python module like python-keystoneclient.

解决方案

This is how I handle this case:

On the machine where I have access to Internet:

mkdir keystone-deps

pip download python-keystoneclient -d "/home/aviuser/keystone-deps"

tar cvfz keystone-deps.tgz keystone-deps

Then move the tar file to the destination machine that does not have Internet access and perform the following:

tar xvfz keystone-deps.tgz

cd keystone-deps

pip install python_keystoneclient-2.3.1-py2.py3-none-any.whl -f ./ --no-index

You may need to add --no-deps to the command as follows:

pip install python_keystoneclient-2.3.1-py2.py3-none-any.whl -f ./ --no-index --no-deps

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值