在Kaggle上安装自定义第三方库

如果你在使用Kernel时想用某个第三方库,但是kaggle上的默认环境没有,可以用下面的方法进行安装(以第三方库torch-geometric为例):

打开Internet

在Kernel的右边侧栏有设置区域,如图所示,让Internet这一选项置为on

如果没开就进行安装会出现如下的错误:

Collecting torch-geometric
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’,)’: /simple/torch-geometric/




ERROR: Could not find a version that satisfies the requirement torch-geometric (from versions: none)
ERROR: No matching distribution found for torch-geometric

在code单元中用pip安装

在Kernel中的code单元中输入如下命令

!pip install torch-geometric

注意前面的感叹号不能省略,等待其安装完毕。

Collecting torch-geometric
Downloading https://files.pythonhosted.org/packages/cc/b2/19eca95445f4657d6f164e3b57342f138780cca2b4a96a7f1a80707d778a/torch_geometric-1.3.0.tar.gz (102kB)
|████████████████████████████████| 112kB 2.8MB/s eta 0:00:01




Installing collected packages: plyfile, isodate, rdflib, torch-geometric
Successfully installed isodate-0.6.0 plyfile-0.7 rdflib-4.2.2 torch-geometric-1.3.0

  • 28
    点赞
  • 43
    收藏
    觉得还不错? 一键收藏
  • 12
    评论
评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值