簡體   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