I have already successfully installed a package in jupyter notebook but failed to import it.

该文指导如何定位已下载的Python包,通过在.pth文件中添加路径到sys.path,确保JupyterNotebook能成功导入模块。步骤包括查找包下载位置,创建.pth文件,写入路径,然后重启Notebook以应用更改。
摘要由CSDN通过智能技术生成

Step 1: Find where the package was downloaded at

Step 2: Run the code below in jupyter notebook

import sys
sys.path

Step 3: Create a xxx.pth file in one of the output paths of the above code

 Step 4: In this xxx.pth file, type the path found in Step 1, watch out the format '\\'

 Step 5: Close and reopen the jupyter notebook, rerun the code in Step 2, you can see the path in the xxx.pth file has already been added in sys.path, now try again the import command

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值