python - 使用google colab将其安装在谷歌驱动器中后无法在pip中找到模块
问题描述
我尝试在谷歌驱动器中安装一个模块,这样我就可以将它永久保存在谷歌 colab 中,甚至重新启动会话。这是我的代码:
# 1. create link to google drive
import os, sys
shortcut = '/content/lib'
source = '/content/drive/MyDrive/Colab Libraries'
os.symlink(source, shortcut)
sys.path.insert(0, shortcut)
# 2. install it
!pip install --target=$shortcut playsound
# 3. try importing it
import playsound # working ok
# 4. find it in the module list
!pip list # cant find playsound
# 5. find it by pip show
!pip show playsound # can't find it as well
playsound
尽管我成功导入了它,但我在 #4 和 #5 中找不到它。我的问题是:
- 我怎样才能将它包含在
pip list
或pip show
- 以及如何卸载它?不能这样做,
pip uninstall playsound
因为它说它找不到模块。
解决方案
推荐阅读
- php - Laravel 将行从一个数据表复制到另一个数据表
- xamarin - 未使用 cloudrail 库 xamarin.ios 连接到 Google 驱动器
- apache2 - 别名 proxypass 优先级如何工作?
- angular - 测试 Angular 组件中名为 subscribe 的方法
- angular - Angular6:尽管绑定,但视图不更新数据更改
- canvas - 如何在 webGL 中创建 2D 挥动旗帜?
- java - 当 eclipse 中包含 foc jar 时,图标消失了
- android - React native - adb 无法安装 Exponent-2.6.4.apk
- python - 如何使用 Pandas 中的 DataFrame 在图表中的 x 轴上显示日期
- scala - 如何仅考虑列的子集删除重复项?