在Kaggle上安装第三方库/wget下载
在默认情况下,kaggle的Kernel不能使用联网的bash命令,诸如wget、pip等,、
只要使用`!`就可以使用bash命令如
!pip install requests
可能会出现如下错误
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘NewConnectionError(’<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f28a73aa9e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’,)
kaggle有setting可以开关网络需要打开,也可以通过谷歌云授权来联网:
1. 有一个谷歌账号
2. 在add-ons选项卡里有GoogleCloudService,授权即可
3. 还可以使用其中提供的服务
# Cloud Storage
from google.cloud import storage
storage_client = storage.Client(project='YOUR PROJECT ID')
# Cloud AutoML
from google.cloud import automl_v1beta1 as automl
automl_client = automl.AutoMlClient()
# Cloud Translation
from google.cloud import translate_v2
translate_client = translate_v2.Client()
# Cloud Natural Language
from google.cloud import language_v1
client = language_v1.LanguageServiceClient()
# Cloud Video Intelligence
from google.cloud import videointelligence
video_client = videointelligence.VideoIntelligenceServiceClient()
# Cloud Vision
from google.cloud import vision
client = vision.ImageAnnotatorClient()
现在kernel可以联网下载第三方库了