Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Opencv 2.4.13需要Python2.7,但单目完全捕获回购需要Python3.5_Python_Linux_Opencv_Tensorflow_Anaconda - Fatal编程技术网

Opencv 2.4.13需要Python2.7,但单目完全捕获回购需要Python3.5

Opencv 2.4.13需要Python2.7,但单目完全捕获回购需要Python3.5,python,linux,opencv,tensorflow,anaconda,Python,Linux,Opencv,Tensorflow,Anaconda,我正在尝试使用此回购协议: 它需要“OpenCV 2.4.13(使用CUDA 9.0和CUDNN 7.0从源代码处编译)”,所以我尝试使用conda安装它。my systen上的默认python安装为: (base) root@ziom-Z87-HD3:/home/ziom# python Python 2.7.16 |Anaconda, Inc.| (default, Sep 24 2019, 21:51:30) [GCC 7.3.0] on linux2 但是repo需要python

我正在尝试使用此回购协议:

它需要“OpenCV 2.4.13(使用CUDA 9.0和CUDNN 7.0从源代码处编译)”,所以我尝试使用conda安装它。my systen上的默认python安装为:

(base) root@ziom-Z87-HD3:/home/ziom# python
Python 2.7.16 |Anaconda, Inc.| (default, Sep 24 2019, 21:51:30) 
[GCC 7.3.0] on linux2
但是repo需要python 3.5,因此我使用以下命令切换到它:

alias python='/usr/bin/python3.5'
conda create -n ziomario pip python=3.5
conda activate ziomario
conda install -c conda-forge opencv=2.4.13
而且它似乎奏效了

(base) root@ziom-Z87-HD3:/home/ziom# python
Python 3.5.2 (default, Oct  8 2019, 13:06:37) 
[GCC 5.4.0 20160609] on linux
现在,它需要安装python 3.5和OpenCV 2.4.13,因此我给出以下命令:

alias python='/usr/bin/python3.5'
conda create -n ziomario pip python=3.5
conda activate ziomario
conda install -c conda-forge opencv=2.4.13
此时,我应该安装OpenCV 2.4.13,并发出以下命令:

alias python='/usr/bin/python3.5'
conda create -n ziomario pip python=3.5
conda activate ziomario
conda install -c conda-forge opencv=2.4.13
但它不起作用,因为:

(ziomario) root@ziom-Z87-HD3:/home/ziom# conda install -c conda-forge opencv=2.4.13
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: / 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
Examining @/linux-64::__glibc==2.23=0:  25%|██▌       | 1/4 [00:00<00:00, 6026.3Examining python=3.5:  50%|█████     | 2/4 [00:00<00:00, 7351.98it/s]           Examining conflict for python opencv:  25%|██▌       | 1/4 [00:00<00:00, 10979.8                                                                                failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - opencv=2.4.13 -> python=2.7

Your python: python=3.5

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with your CUDA driver:

  - feature:/linux-64::__cuda==9.0=0

Your installed CUDA driver is: 9.0
(齐奥马里奥)root@ziom-Z87-HD3:/home/ziom#conda安装-c conda forge opencv=2.4.13
收集包元数据(current_repodata.json):完成
解决环境:初始冻结解决失败。用灵活的解决方法重试。
收集包元数据(repodata.json):完成
解决环境:初始冻结解决失败。用灵活的解决方法重试。
解决环境:/
发现冲突!正在查找不兼容的包。
这可能需要几分钟。按CTRL-C以中止。

检查@/linux-64::u glibc==2.23=0:25%|██▌ | 1/4[00:00这很奇怪,因为repo明确表示它应该使用您试图使用的内容。我猜是有人在依赖项列表上犯了错误。请尝试先升级Opencv,然后联系repo维护人员,因为他们编写了矛盾。要做到这一点,您可能需要使用“pyenv”

我发现这个网站非常有用:

假设您使用的是Ubuntu或Debian系统,我将对这些步骤进行总结

首先,如果尚未下载依赖项,请下载该依赖项:

$sudo apt get install-y生成基本libssl dev zlib1g dev\
libbz2开发libreadline开发libsqlite3开发wget curl llvm libncurse5开发\
libncursesw5 dev xz utils tk dev libffi dev liblzma dev python openssl
然后使用pyenv安装程序:

$curlhttps://pyenv.run |猛击
这将安装pyenv以及一些有用的插件:

  • pyenv:实际的pyenv应用程序
  • pyenv-virtualenv:用于pyenv和虚拟环境的插件
  • pyenv更新:用于更新pyenv的插件
  • pyenv-doctor:用于验证是否安装了pyenv和构建依赖项的插件
  • pyenv哪个ext:Plugin可以自动查找系统命令
  • 在运行结束时,您应该看到如下内容:

    WARNING: seems you still have not added 'pyenv' to the load path.
    
    # Load pyenv automatically by adding
    # the following to ~/.bashrc:
    
    export PATH="$HOME/.pyenv/bin:$PATH"
    eval "$(pyenv init -)"
    eval "$(pyenv virtualenv-init -)"
    
    The output will be based on your shell. But you should follow the instructions to add pyenv to your path and to initialize pyenv/pyenv-virtualenv auto completion. Once you’ve done this, you need to reload your shell:
    
    然后,您可以使用该命令安装python版本:

    $pyenv安装-v3.5
    

    还有更多…(访问网站)

    我做到了:conda create-n ziomario pip python=2.7;conda activate ziomario;conda install-c conda forge opencv=2.4.13。我没有错误,但我不确定它是否正确,因为我得到了与以前相同的错误:ImportError:没有名为“numpy”的模块。也许这不是解决此错误的方法。请点击这里:但repo需要python 3.5这就是我用这个命令切换到它的原因。这样做的意义是什么?你不会在一个环境中运行Python吗?