【问题标题】:Conda install 3.4.1 Specifications in conflict: opencv and r-base or ncurses5.9*Conda install 3.4.1 规范冲突:opencv 和 r-base 或 ncurses5.9*
【发布时间】:2017-10-19 14:01:11
【问题描述】:

我尝试了this post中提到的解决方案

这里是终端输出(操作系统是 Ubuntu 14.04 64 位)

~$ conda install -c r r=3.4.1

Fetching package metadata .............
Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:
  - opencv
  - r 3.4.1* -> r-base 3.4.1 -> ncurses 5.9*
Use "conda info <package>" to see the dependencies for each package.

我遵循终端建议:

    ~$ conda info opencv

-----------------------
file name   : opencv-2.4.2-np17py26_1.tar.bz2
name        : opencv
version     : 2.4.2
build string: np17py26_1
build number: 1
channel     : defaults
size        : 7.1 MB
arch        : x86_64
date        : 2013-03-10
license     : BSD 3-clause
license_family: BSD
md5         : 167ec5f8f898eadc9641eaa71c1c9d58
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.7*
    python 2.6*
    zlib 1.2*

opencv 2.4.2 np17py27_1
-----------------------
file name   : opencv-2.4.2-np17py27_1.tar.bz2
name        : opencv
version     : 2.4.2
build string: np17py27_1
build number: 1
channel     : defaults
size        : 7.2 MB
arch        : x86_64
date        : 2012-10-11
license     : BSD 3-clause
license_family: BSD
md5         : e6cbf983f6359d1ed868861691e619a7
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.7*
    python 2.7*
    zlib 1.2*

opencv 2.4.6 np16py26_0
-----------------------
file name   : opencv-2.4.6-np16py26_0.tar.bz2
name        : opencv
version     : 2.4.6
build string: np16py26_0
build number: 0
channel     : defaults
size        : 8.0 MB
arch        : x86_64
date        : 2013-08-07
license     : BSD 3-clause
license_family: BSD
md5         : f83a9121158188bd5275425931266488
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.6*
    python 2.6*
    zlib 1.2*

opencv 2.4.6 np16py27_0
-----------------------
file name   : opencv-2.4.6-np16py27_0.tar.bz2
name        : opencv
version     : 2.4.6
build string: np16py27_0
build number: 0
channel     : defaults
size        : 8.2 MB
arch        : x86_64
date        : 2013-08-07
license     : BSD 3-clause
license_family: BSD
md5         : c22c3a12b08c5e51ed9810dc0209115a
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.6*
    python 2.7*
    zlib 1.2*

opencv 2.4.6 np17py26_0
-----------------------
file name   : opencv-2.4.6-np17py26_0.tar.bz2
name        : opencv
version     : 2.4.6
build string: np17py26_0
build number: 0
channel     : defaults
size        : 8.0 MB
arch        : x86_64
date        : 2013-08-07
license     : BSD 3-clause
license_family: BSD
md5         : 27506a7d6fa42a222381871240a02a36
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.7*
    python 2.6*
    zlib 1.2*

opencv 2.4.6 np17py27_0
-----------------------
file name   : opencv-2.4.6-np17py27_0.tar.bz2
name        : opencv
version     : 2.4.6
build string: np17py27_0
build number: 0
channel     : defaults
size        : 8.2 MB
arch        : x86_64
date        : 2013-08-07
license     : BSD 3-clause
license_family: BSD
md5         : c31a6c8e66746966a160e2872f1c6760
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.7*
    python 2.7*
    zlib 1.2*

opencv 2.4.6 np18py26_0
-----------------------
file name   : opencv-2.4.6-np18py26_0.tar.bz2
name        : opencv
version     : 2.4.6
build string: np18py26_0
build number: 0
channel     : defaults
size        : 8.1 MB
arch        : x86_64
date        : 2014-01-29
license     : BSD 3-clause
license_family: BSD
md5         : e1db0c8b01eaa5b155994b81625ffa84
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.8*
    python 2.6*
    zlib 1.2*

opencv 2.4.6 np18py27_0
-----------------------
file name   : opencv-2.4.6-np18py27_0.tar.bz2
name        : opencv
version     : 2.4.6
build string: np18py27_0
build number: 0
channel     : defaults
size        : 8.2 MB
arch        : x86_64
date        : 2014-01-29
license     : BSD 3-clause
license_family: BSD
md5         : 945a3aa6fcd74e3021de9de4f46274c0
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.8*
    python 2.7*
    zlib 1.2*

opencv 2.4.9 np18py27_0
-----------------------
file name   : opencv-2.4.9-np18py27_0.tar.bz2
name        : opencv
version     : 2.4.9
build string: np18py27_0
build number: 0
channel     : defaults
size        : 8.9 MB
arch        : x86_64
date        : 2014-05-08
license     : BSD 3-clause
license_family: BSD
md5         : 2978366085211063867671620b6a8d1c
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.8*
    python 2.7*
    zlib 1.2*

opencv 2.4.10 np19py26_0
------------------------
file name   : opencv-2.4.10-np19py26_0.tar.bz2
name        : opencv
version     : 2.4.10
build string: np19py26_0
build number: 0
channel     : defaults
size        : 9.1 MB
arch        : x86_64
date        : 2015-01-05
license     : BSD 3-clause
license_family: BSD
md5         : 83c32af1039ebefa35e219756dd58e78
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.9*
    python 2.6*
    zlib 1.2*

opencv 2.4.10 np19py27_0
------------------------
file name   : opencv-2.4.10-np19py27_0.tar.bz2
name        : opencv
version     : 2.4.10
build string: np19py27_0
build number: 0
channel     : defaults
size        : 9.2 MB
arch        : x86_64
date        : 2015-01-05
license     : BSD 3-clause
license_family: BSD
md5         : abc16cfb98eaa4b3a0782664e08d907a
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.5.13
    numpy 1.9*
    python 2.7*
    zlib 1.2*

opencv 2.4.10 np110py27_1
-------------------------
file name   : opencv-2.4.10-np110py27_1.tar.bz2
name        : opencv
version     : 2.4.10
build string: np110py27_1
build number: 1
channel     : defaults
size        : 9.2 MB
arch        : x86_64
date        : 2015-10-06
license     : BSD
md5         : 6b4bb1b8a55a735d68c554aebf0d9970
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.6.17
    numpy 1.10*
    python 2.7*
    zlib 1.2*

opencv 2.4.10 np19py26_1
------------------------
file name   : opencv-2.4.10-np19py26_1.tar.bz2
name        : opencv
version     : 2.4.10
build string: np19py26_1
build number: 1
channel     : defaults
size        : 9.1 MB
arch        : x86_64
date        : 2015-05-27
license     : BSD
md5         : e4b190bada3d7e908dbfb209adb5eed7
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.6.17
    numpy 1.9*
    python 2.6*
    zlib 1.2*

opencv 2.4.10 np19py27_1
------------------------
file name   : opencv-2.4.10-np19py27_1.tar.bz2
name        : opencv
version     : 2.4.10
build string: np19py27_1
build number: 1
channel     : defaults
size        : 9.2 MB
arch        : x86_64
date        : 2015-05-26
license     : BSD
md5         : 82e1145622e1ba343528def4cd3d6460
noarch      : None
platform    : linux

dependencies:
    jpeg 8d
    libpng 1.6.17
    numpy 1.9*
    python 2.7*
    zlib 1.2*

opencv 3.1.0 np111py27_1
------------------------
file name   : opencv-3.1.0-np111py27_1.tar.bz2
name        : opencv
version     : 3.1.0
build string: np111py27_1
build number: 1
channel     : defaults
size        : 36.5 MB
arch        : x86_64
date        : 2016-12-20
license     : BSD 3-clause
license_family: BSD
md5         : 9040653dd93bf7e9482ec05c76ddc06b
noarch      : None
platform    : linux

dependencies:
    hdf5 1.8.*
    hdf5 >=1.8.17
    jpeg 8*
    libpng >=1.6.21,<1.7
    libtiff 4.0.*
    numpy 1.11*
    python 2.7*
    zlib 1.2.*

opencv 3.1.0 np111py34_1
------------------------
file name   : opencv-3.1.0-np111py34_1.tar.bz2
name        : opencv
version     : 3.1.0
build string: np111py34_1
build number: 1
channel     : defaults
size        : 36.5 MB
arch        : x86_64
date        : 2016-12-20
license     : BSD 3-clause
license_family: BSD
md5         : 2b824ac1d6d1290e022987ac8c71f690
noarch      : None
platform    : linux

dependencies:
    hdf5 1.8.*
    hdf5 >=1.8.17
    jpeg 8*
    libpng >=1.6.21,<1.7
    libtiff 4.0.*
    numpy 1.11*
    python 3.4*
    zlib 1.2.*

opencv 3.1.0 np111py35_1
------------------------
file name   : opencv-3.1.0-np111py35_1.tar.bz2
name        : opencv
version     : 3.1.0
build string: np111py35_1
build number: 1
channel     : defaults
size        : 36.5 MB
arch        : x86_64
date        : 2016-12-20
license     : BSD 3-clause
license_family: BSD
md5         : 6a0c25a7986fc83e6fd7b956558f2753
noarch      : None
platform    : linux

dependencies:
    hdf5 1.8.*
    hdf5 >=1.8.17
    jpeg 8*
    libpng >=1.6.21,<1.7
    libtiff 4.0.*
    numpy 1.11*
    python 3.5*
    zlib 1.2.*

opencv 3.1.0 np112py27_1
------------------------
file name   : opencv-3.1.0-np112py27_1.tar.bz2
name        : opencv
version     : 3.1.0
build string: np112py27_1
build number: 1
channel     : defaults
size        : 36.6 MB
arch        : x86_64
date        : 2017-04-11
license     : BSD 3-clause
license_family: BSD
md5         : ea63a31444efea586160844a6af08283
noarch      : None
platform    : linux

dependencies:
    hdf5 1.8.17
    jpeg 8*
    libpng >=1.6.21,<1.7
    libtiff 4.0.*
    numpy 1.12*
    python 2.7*
    zlib 1.2.*

opencv 3.1.0 np112py35_1
------------------------
file name   : opencv-3.1.0-np112py35_1.tar.bz2
name        : opencv
version     : 3.1.0
build string: np112py35_1
build number: 1
channel     : defaults
size        : 36.6 MB
arch        : x86_64
date        : 2017-04-11
license     : BSD 3-clause
license_family: BSD
md5         : f83d2ad5b29502bbadb19de046116fa8
noarch      : None
platform    : linux

dependencies:
    hdf5 1.8.17
    jpeg 8*
    libpng >=1.6.21,<1.7
    libtiff 4.0.*
    numpy 1.12*
    python 3.5*
    zlib 1.2.*

opencv 3.1.0 np112py36_1
------------------------
file name   : opencv-3.1.0-np112py36_1.tar.bz2
name        : opencv
version     : 3.1.0
build string: np112py36_1
build number: 1
channel     : defaults
size        : 36.6 MB
arch        : x86_64
date        : 2017-04-11
license     : BSD 3-clause
license_family: BSD
md5         : 4593f5ab3af8a0be8b67fb8d19b0d95b
noarch      : None
platform    : linux

dependencies:
    hdf5 1.8.17
    jpeg 8*
    libpng >=1.6.21,<1.7
    libtiff 4.0.*
    numpy 1.12*
    python 3.6*
    zlib 1.2.*

opencv 的所有 URL 都来自 https://repo.continuum.io/pkgs/free/linux-64。我是否正确假设这些是 Anaconda 中所有 opencv 版本的 URL,而不是我的机器?

那我试试

~$ conda info R

它提供了 Anaconda 中可用的大量 R 版本表。值得注意的是这个输出:

    r 3.4.1 r3.4.1_0
----------------
file name   : r-3.4.1-r3.4.1_0.tar.bz2
name        : r
version     : 3.4.1
build string: r3.4.1_0
build number: 0
channel     : defaults
size        : 2 KB
arch        : x86_64
has_prefix  : False
md5         : 08866376864836652ea5a72ab9cbdb60
noarch      : None
platform    : linux
subdir      : linux-64
url         : https://repo.continuum.io/pkgs/r/linux-64/r-3.4.1-r3.4.1_0.tar.bz2
dependencies:
    r-base 3.4.1
    r-recommended 3.4.1

很明显,R 3.4.1 在 Anaconda R 频道中可用。然而安装失败。如何修复或更好地排除故障?

【问题讨论】:

    标签: r opencv anaconda


    【解决方案1】:

    你必须沿着依赖链向下直到找到实际的冲突。在这种情况下,错误是因为 Python(在这种情况下为 2.7)需要 ncurses 6.0.*,而 R 需要 ncurses 5.9.*。您应该创建一个安装 R 的新环境:

    conda create -n renv -c r r=3.4.1
    

    【讨论】:

    • 谢谢,这就像一个魅力!新的 renv 文件是在 ~/anaconda2/envs 文件夹中创建的。现在,如何让 Anaconda 中的 RStudio 使用这个新创建的 R 环境?我是否通过将这一行放在我的 bash.bashrc 文件夹中来做到这一点? export RSTUDIO_WHICH_R=/home/[username]/anaconda2/envs/renv/bin/R RStudio 是由 Anaconda 安装的,所以我不确定它是否可以工作。
    • 不幸的是,我不知道 :-) 最好问一个新问题(但先搜索看看它是否已经回答了!)。另外,如果这个答案对您有帮助,请考虑投票或接受答案:stackoverflow.com/help/someone-answers
    • 好的,我会这样做的。谢谢!
    猜你喜欢
    • 2023-03-20
    • 2021-09-09
    • 1970-01-01
    • 2012-09-10
    • 2023-03-24
    • 2016-12-19
    • 2021-12-15
    • 2019-04-04
    相关资源
    最近更新 更多