2

I am using Ubuntu 20 focal and am having problems with the Anaconda installation process and operation. Using the file: Anaconda3-2020.07-Linux-x86_64.sh, and running via: sudo bash Anaconda3-2020.07-Linux-x86_64.sh I press ENTER after the welcome message, go through all the agreement messages and press yes that I agree, and then see the response:

Please answer 'yes' or 'no':'
>>> yes

Anaconda3 will now be installed into this location:
/root/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/anaconda3] >>> 

I then press ENTER, the installation takes place and now there is an installation at

$ sudo ls /root/
anaconda3

But, after this the commands expected to work do not,eg;

$ conda list
conda: command not found

I cannot use conda uninstall commands and wonder how the installation procedure should have taken place. The installation has not placed any files in ~/.

I have a Julia lang installation as well and there is a reference to it from an environments.txt file;

$ ls ~/.conda/
environments.txt
usr3@usr3:~$ ls ~/.conda/environments.txt 
.conda/environments.txt
usr3@usr3:~$ head ~/.conda/environments.txt 
/home/usr3/.julia/conda/3
usr3@usr3:~$ ls /home/usr3/.julia/conda/
3/       deps.jl  
usr3@usr3:~$ ls /home/usr3/.julia/conda/3/
bin/                         installer.sh
compiler_compat/             lib/
condabin/                    LICENSE.txt
conda-meta/                  pkgs/
condarc-julia.yml            share/
envs/                        shell/
etc/                         ssl/
include/                     x86_64-conda_cos6-linux-gnu/
Vass
  • 2,682
  • 13
  • 41
  • 60
  • 1
    Is `sudo` actually needed? That is mostly for system admins managing a multi-user install; typical install never requires elevated privileges. – merv Oct 08 '20 at 02:04
  • @merv, I used `sudo` out of habit. It came without thinking. After trying without sudo, the installation recommended a directory that was expected `>>> yes Anaconda3 will now be installed into this location: /home/resort/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/home/usr3/anaconda3] >>> ERROR: File or directory already exists: '/home/resort/anaconda3' If you want to update an existing installation, use the -u option.` Although this seems like progress this new installation didn't engage `conda` – Vass Oct 08 '20 at 02:19
  • 1
    Did you run `/home/resort/anaconda3/bin/conda init`, then restart the shell? – merv Oct 08 '20 at 02:20
  • @merv, `/home/resort/anaconda3/bin` does not have a `conda-init` file. it has other files, eg `conda-build` – Vass Oct 08 '20 at 02:35
  • 1
    It should have simply `conda`; the `init` is an argument. – merv Oct 08 '20 at 02:46
  • @merv, well, that did it! Thanks alot! can you put your comments into an answer so I can award it to you? Why do I have `base` before the username on the terminal now? Is it of concern? Also, by any chance if you have any understanding of this question: https://stackoverflow.com/questions/64236638/why-r-library-ssw-cannot-find-python-module-installed-via-pip3-although-pip3 your insight would be appreciated – Vass Oct 08 '20 at 02:57
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/222694/discussion-between-vass-and-merv). – Vass Oct 08 '20 at 03:01

1 Answers1

1

The unexpected installation location in OP is likely due to running the installer with elevated privileges (sudo bash ...). Typically, only system administrators and others managing a multi-user install should require elevated privileges. The default install should not use sudo, which will instead result in installing somewhere under the user's home.

I haven't run the installer in a while, but I thought that it now includes an automatic run of conda init as part of the install. If not, please consult this answer with details on how to set up Conda's shell functionality (e.g., conda activate).

merv
  • 67,214
  • 13
  • 180
  • 245