7

I am trying to install opencv using the command

conda install opencv

This command worked on my laptop, but i am getting following error when I try it on my desktop computer. Both systems are running Ubuntu 14.04

Fetching package metadata: ....
Solving package specifications: ....................
Package plan for installation in environment /home/ws2/anaconda2:

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
openssl-1.0.2e             |                0         3.2 MB  defaults
sqlite-3.9.2               |                0         3.9 MB  defaults
numpy-1.10.2               |           py27_0         5.9 MB  defaults
requests-2.9.1             |           py27_0         605 KB  defaults
setuptools-19.4            |           py27_0         365 KB  defaults
conda-3.19.0               |           py27_0         176 KB  defaults
opencv-2.4.10              |      np110py27_1         9.2 MB  defaults
pip-8.0.1                  |           py27_0         1.5 MB  defaults
------------------------------------------------------------
                                       Total:        24.8 MB

The following NEW packages will be INSTALLED:

opencv:     2.4.10-np110py27_1 defaults (soft-link)

The following packages will be UPDATED:

conda:      3.18.8-py27_0 defaults --> 3.19.0-py27_0      defaults (soft-link)
numpy:      1.10.1-py27_0 defaults --> 1.10.2-py27_0      defaults (soft-link)
openssl:    1.0.2d-0      defaults --> 1.0.2e-0           defaults (soft-link)
pip:        7.1.2-py27_0  defaults --> 8.0.1-py27_0       defaults (soft-link)
requests:   2.8.1-py27_0  defaults --> 2.9.1-py27_0       defaults (soft-link)
setuptools: 18.5-py27_0   defaults --> 19.4-py27_0        defaults (soft-link)
sqlite:     3.8.4.1-1     defaults --> 3.9.2-0            defaults (soft-link)

Error: Missing write permissions in: /home/ws2/anaconda2
#
# You don't appear to have the necessary permissions to install packages
# into the install area '/home/ws2/anaconda2'.
# However you can clone this environment into your home directory and
# then make changes to it.
# This may be done using the command:
#
# $ conda create -n my_root --clone=/home/ws2/anaconda2
Mobeen
  • 359
  • 1
  • 2
  • 13
  • What is this 'conda' command you're using? – Anders Olsson Jan 27 '16 at 08:59
  • Conda is an open source package management system and environment management system for installing multiple versions of software packages and their dependencies and switching easily between them. [link] (http://conda.pydata.org/docs/) – Mobeen Jan 27 '16 at 09:05
  • Did you install conda from the official Ubuntu repos? Otherwise, it's hard to see this a Ubuntu question, that should be handled in this community. BTW, did you try the command the help text hinted to: `conda create -n my_root --clone=/home/ws2/anaconda2`? – Anders Olsson Jan 27 '16 at 09:32

3 Answers3

17

The problem was that somehow "anaconda2" folder where "anaconda" is installed, was set to 'access only' because the owner of "anaconda2" folder was "root". Now I have changed the ownership of "anaconda2" folder by using command

sudo chown -R ws2 anaconda
sudo chown -R usr foldername
Mobeen
  • 359
  • 1
  • 2
  • 13
0

follow the following commands and work accordingly whenever there comes an issue related to these permission. what i have done here is i changed the permission of all files and subfolders of 'pkgs' folder in anaconda directories. sudo chown -R 'user': /home/user/anaconda/pkgs

this worked for me in your case do

sudo chown -R ws2: /home/ws2/anaconda2

0

Please try running your command using sudo, like this:

  sudo conda install opencv
Weboide
  • 10,363
  • 11
  • 33
  • 38
mohit singh
  • 309
  • 2
  • 6
  • 9
    conda doesn't work with sudo – Mobeen Jan 31 '16 at 09:50
  • You can make this work with a root user, you usually just need to provide the correct `PATH` for the root user, using `sudo env "PATH=$PATH" conda install ...`. If you aren't sure what this is doing, probably best not to use it! – n1k31t4 May 25 '17 at 12:26