如何在Google Colaboratory的Jupyter笔记本中安装svmutil? [英] How to install svmutil in Jupyter notebook on Google Colaboratory?
本文介绍了如何在Google Colaboratory的Jupyter笔记本中安装svmutil?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用 https://github.com/中的svmutil函数我的Jupyter笔记本中的Netflix/vmaf/tree/master/libsvm/python ,该笔记本可在Google合作实验室上运行.
I want to use svmutil functions from https://github.com/Netflix/vmaf/tree/master/libsvm/python in my Jupyter notebook which runs on Google Colaboratory.
运行
import svmutil
出现以下错误:
ModuleNotFoundError: No module named 'svmutil'
如何在colab中安装此github存储库?
How do I install this github repo in colab?
推荐答案
您需要先安装该库.这是一个完整的示例:
You'll need to install the library first. Here's a complete example:
https://colab.research.google.com/drive/1svYMGnV7HdeqXpN15T5ajxbLijL>
https://colab.research.google.com/drive/1svYMGnV7HdeqXpN15T5ajxbLijLmBeSm
关键位:
# Clone the git repo.
!git clone https://github.com/Netflix/vmaf.git
# Build the library.
%cd vmaf/
!make && make install
# Build Python-specific bits.
%cd /content/vmaf/libsvm/python/
!make
# Add the Python module to the path.
import sys
sys.path.append('/content/vmaf/libsvm/python')
# Switch back to the base directory. (This is a convenience
# and isn't required.)
%cd /content
这篇关于如何在Google Colaboratory的Jupyter笔记本中安装svmutil?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文