繁体   English   中英

Google Colab的SSL证书

[英]SSL Cert with Google Colab

使用Google Colab并尝试连接到外部API。

我已经创建了一组SSL证书,并且想要部署它们,我已经安装了驱动器并引用了正确的文件夹,但是失败了。

import betfairlightweight

from google.colab import drive 
from google.colab import files
#!pip install -U pyopenssl
drive.mount('content')
    # Change this certs path to wherever you're storing your certificates
certs_path = 'content/My Drive/betfair/'

# Change these login details to your own
my_username = XXXXX
my_password = XXXXX
my_app_key = XXXXX
trading = betfairlightweight.APIClient(username=my_username,
                                       password=my_password,
                                       app_key=my_app_key
                                       ,certs=certs_path)

证书存在,但是当我

certs_path ='content/My Drive/betfair'

!ls certs_path

我得到错误

ls: cannot access 'certs_path': No such file or directory

如何使用Colab指向我的Google驱动器中的正确certs文件夹

betfairlightweight.APIClient()调用失败? 尝试将路径/content/My Drive/betfair/绝对: /content/My Drive/betfair/

您在!ls certs_path看到的问题无关。 使用时! Colab中的操作符以运行Shell命令不会使用您的python变量。 它只将“ certs_path”视为文本。

尝试:

!ls /content/My Drive/betfair

确保正确安装东西。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM