带有公司签名 SSL 证书的 Python 设置工具 [英] Python setuptools with company signed SSL certificate

查看:37
本文介绍了带有公司签名 SSL 证书的 Python 设置工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Python setuptools 的新手.

I am new to setuptools on python.

我在 install_requires 列表中添加了一个包 'numpy' 和 'tensorflow' 并运行 python setup.py install.由于 SSL 问题,它不会安装.我们对基于 https 的 URL 使用自签名 SSL.

I added a package 'numpy' and 'tensorflow' to install_requires list and running python setup.py install. It does not install due to SSL issue. We use self signed SSL for https based urls.

如果是单个包的 pip,我可以使用 --cert 选项.据我所知,setuptools 间接使用 pip.如果是这样,在运行 setup.py 时是否有任何方式强制它使用 --cert 选项?

In case of pip for individual packages I can use --cert option. As I know setuptools use pip indirectly. If so, is there anyway to force it to use --cert option when setup.py is ran?

推荐答案

事实证明,我们实际上有两个问题.

It turns out that we have actually two problems here.

tensorflow的问题与egg和wheel包的一些区别有关.

The problem about tensorflow is related some difference between egg and wheel packages.

为了解决numpy和其他包的问题,​​在~/.pip/pip.conf文件中添加以下行就足够了:

To solve the problem about numpy and other packages it is enough to add the following line into ~/.pip/pip.conf file:

[global]    
cert=/path/to/cert.crt

如果需要,您可以添加任何其他相同格式的选项值(包括代理).

If necessarry you may add any other option values (including proxy) with same format.

这篇关于带有公司签名 SSL 证书的 Python 设置工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆