【问题标题】:How to install umap and umap.plot with Google Colab如何使用 Google Colab 安装 umap 和 umap.plot
【发布时间】:2020-05-21 07:03:31
【问题描述】:

我提前为这个问题道歉,但我陷入了 GitHub 问题讨论和!pip install ... 尝试之间的循环。

问题是我无法将包umap,更具体地说,umap.plot 导入 Python 在 Google Colab 中 起初它给了我一个警告,我需要安装 holoviews ,datashader 和 bokeh 在安装 umap 之前,我确实确保安装了所有必需的软件包。由于它仍然无法使用所有导入命令运行单元,因此我更改了包的顺序,将 umap 留在最后,这没有帮助。事实上,突然之间,问题似乎是全息视图,尽管我似乎已经成功安装了它。查看我得到的错误(右侧):

这是代码的sn-p:

%autosave 0

import warnings; warnings.simplefilter('ignore')

import matplotlib.pyplot as plt

import pandas as pd
import numpy as np
import seaborn as sns

from mpl_toolkits.mplot3d import Axes3D
from matplotlib.ticker import NullFormatter

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn import manifold
from sklearn.utils import check_random_state

import holoviews
import datashader
import bokeh
from bokeh.plotting import show, save, output_notebook, output_file
from bokeh.resources import INLINE 

import umap
import umap.plot

plt.rcParams["figure.figsize"] = (20,10)

这是更改包顺序之前的原始错误消息:

【问题讨论】:

    标签: python google-colaboratory


    【解决方案1】:

    我刚刚跑了

    !pip install umap-learn[plot]
    !pip install holoviews
    !pip install -U ipykernel
    

    一切都清楚了!

    here得到这个。

    【讨论】:

    • holoviews 1.13 似乎与 Colab 冲突。您可能需要指定holoviews==1.12.7
    猜你喜欢
    • 2018-11-13
    • 2019-07-03
    • 2018-09-25
    • 2018-11-06
    • 2018-07-03
    • 2019-12-06
    • 2021-11-09
    • 2021-08-10
    相关资源
    最近更新 更多