Search code examples
pythonpython-3.xjupyter-notebookcondagraphviz

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


I was trying to download the graphviz library via conda in Jupyter Notebook (later I checked in terminal it goes in the same way). Unfortunately, I see the warning conda not found.

Firstly, I wrote this (in Jupyter):

!pip install conda --user

and got:

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)

After, I wrote next:

!conda install python-graphviz --yes

but it showed:

/bin/sh: 1: conda: not found

How can I fix this error to use conda?


Solution

  • conda is not a pip package. I think some backlevel version once got released on PyPI, but I wouldn't try to use that nowadays.

    Install the Miniconda package to use conda: https://docs.conda.io/en/latest/miniconda.html

    And tell pip to remove that conda package it installed.