I have just install anaconda (python 2.7 version) in /usr/local/bin
I added /usr/local/bin/anaconda2/bin/
to the path.
Now when I run conda
from the command prompt it runs fine (but can't install anything without sudo
because of the directory it's in).
However when I run the same command with sudo
it can't find conda
.
Does anyone know why this is?
Without sudo
:
$ conda
usage: conda [-h] [-V] command ...
conda is a tool for managing and deploying applications, environments and packages.
Options:
positional arguments:
command
With sudo
:
$ sudo conda
sudo: conda: command not found
export
is a shell builtin - sosudo export
fails for essentially the reason that sudo cannot do cd. It wouldn't help anyway because sudo uses its ownsecure_path
defined in the/etc/sudoers
file. – steeldriver Feb 13 '18 at 19:30