28

I installed Conda using its 32 bits .sh file from here.

Here are the essential parts of the installation procedure that worked fine:

Do you approve the license terms? [yes|no]
[no] >>> yes

Miniconda3 will now be installed into this location:
/home/begueradj/miniconda3

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

[/home/begueradj/miniconda3] >>> 
PREFIX=/home/begueradj/miniconda3
installing: python-3.4.2-0 ...
installing: conda-env-2.0.1-py34_0 ...
installing: openssl-1.0.1k-0 ...
installing: pycosat-0.6.1-py34_0 ...
installing: pyyaml-3.11-py34_0 ...
installing: readline-6.2-2 ...
installing: requests-2.5.1-py34_0 ...
installing: sqlite-3.8.4.1-0 ...
installing: system-5.8-1 ...
installing: tk-8.5.15-0 ...
installing: xz-5.0.5-0 ...
installing: yaml-0.1.4-0 ...
installing: zlib-1.2.8-0 ...
installing: conda-3.8.3-py34_0 ...
Python 3.4.2 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
Do you wish the installer to prepend the Miniconda3 install location
to PATH in your /home/begueradj/.bashrc ? [yes|no]
[no] >>> yes

Prepending PATH=/home/begueradj/miniconda3/bin to PATH in /home/begueradj/.bashrc
A backup will be made to: /home/begueradj/.bashrc-miniconda3.bak


For this change to become active, you have to open a new terminal.

Thank you for installing Miniconda3!
begueradj@begueradj-HP-Compaq-6510b-KE130ET-ABF:~/Desktop$ 

When I type sudo conda install something, I get this error:

sudo: conda: command not found

How can I resolve this problem ?

muru
  • 197,895
  • 55
  • 485
  • 740

4 Answers4

23

Well, I'm not used to find answers to my question this quickly, but for this one I did:

I had only to remove the sudo before the conda command.

Explanation:

All conda commands must be run without super user privileges.

Hope it can help someone in the future.

  • 5
    Indeed, this is the right answer. Conda installs in the home directory with user privileges. You should avoid using sudo with conda, as that would write files with non-user permissions, and you would have to use sudo every time thereafter to modify those files. – asmeurer Feb 23 '15 at 22:42
  • 5
    If I do this, I get a CondaIOError: Missing write permissions in: /anaconda. – Thomas Ahle Nov 13 '17 at 13:34
  • @ThomasAhle You should start a new question, you can link this one and specify what exactly you did and what the result was. – Melebius Jan 08 '18 at 10:07
  • 1
    In my case I installed I installed conda to opt/anaconda so I now need to run it with sudo. So I fixed it by adding export PATH="/opt/anaconda/bin:$PATH" to my sudo bash – Gabriel Fair Apr 20 '18 at 17:31
  • 1
    This false. Root permissions are required to edit the base environment when a system-wide install is done. – Myridium Apr 16 '21 at 02:46
16

If you are getting a CondaIOError with conda command, it means that the conda directory does not have enough permissions to download and save new libraries.

Just execute these commands in terminal, and you'll be good to go:

sudo chown -R username /home/username/path-to-conda-folder/

sudo chmod -R +x /home/username/path-to-conda-folder/

Change username and path-to-conda-folder according to your PC.

Hope this helps! :)

Saurabh
  • 261
11

You can do the following Before running the sudo command type

which conda

then use the full conda path

sudo ~/install/ananconda//5.1../etc install myPackageName
2

If you decide to run with sudo permissions you shoud run conda specifying explicity the path of the conda executable. That path can ve investigated with which conda.