如何修复 Ubuntu 中的 "conda: not found" 错误

How to fix "conda: not found" error in Ubuntu

我试图通过 Jupyter Notebook 中的 conda 下载 graphviz 库(后来我在终端中检查它以相同的方式进行)。不幸的是,我看到警告 conda not found。

首先,我写了这个(在 Jupyter 中):

!pip install conda --user

并得到:

Requirement already satisfied: conda in /home/user_name/.local/lib/python3.6/site-packages (4.3.16)
Requirement already satisfied: pycosat>=0.6.1 in /home/user_name/.local/lib/python3.6/site-packages (from conda) (0.6.3)
Requirement already satisfied: ruamel.yaml>=0.11.14 in /home/user_name/.local/lib/python3.6/site-packages (from conda) (0.16.1)
Requirement already satisfied: requests>=2.12.4 in /usr/lib/python3/dist-packages (from conda) (2.18.4)
Requirement already satisfied: ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.8" in /home/user_name/.local/lib/python3.6/site-packages (from ruamel.yaml>=0.11.14->conda) (0.1.2)

之后,我写下了:

!conda install python-graphviz --yes

但它显示:

/bin/sh: 1: conda: not found

如何修复此错误以使用 conda?

conda 不是 pip 包。我认为曾经在 PyPI 上发布了一些后级版本,但我现在不会尝试使用它。

安装要使用的 Miniconda 包 condahttps://docs.conda.io/en/latest/miniconda.html

并告诉 pip 删除它安装的那个 conda 包。