简体   繁体   English

Windows上的OpenCV安装失败

[英]OpenCV installation failure on windows

Hi I am trying to install opencv on windows. 嗨,我正在尝试在Windows上安装opencv。 I am using python version 3.7.3. 我正在使用python版本3.7.3。 I have tried the installation tutorials using pip, conda and also followed steps outlined in the documentation: https://www.learnopencv.com/install-opencv-4-on-windows/ . 我已经尝试过使用pip,conda进行安装教程,并且还遵循了文档中概述的步骤: https : //www.learnopencv.com/install-opencv-4-on-windows/ But no success. 但是没有成功。 I am getting the same error regardless of the approach. 无论采用哪种方法,我都会遇到相同的错误。

Fetching package metadata ...
    CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/a
    naconda/win-64/repodata.json>
    Elapsed: -

    An HTTP error occurred when trying to retrieve this URL.
    HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'tls_process_server_certificate\', \'certificate verify failed\')])")))'))

ERROR: Could not find a version that satisfies the requirements dlib(from versions:none) ERROR: No matching distribution found for dlib 错误:找不到满足要求dlib的版本(从版本:无)错误:找不到dlib的匹配发行版

any suggestions on how to solve this issue. 有关如何解决此问题的任何建议。

Looks like Conda installer can't verify SSL certificate. 看起来Conda安装程序无法验证SSL证书。

As a workaround you can use a common way of installing Python packages using pip in OS terminal if you already have Python and pip installed. 作为一种解决方法,如果已经安装了Python和pip,则可以使用在OS终端中使用pip安装Python软件包的常用方法。

Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution) 适用于标准桌面环境的软件包(Windows,macOS,几乎所有GNU / Linux发行版)

  • run pip install opencv-python if you need only main modules 如果只需要主要模块,请运行pip install opencv-python
  • run pip install opencv-contrib-python if you need both main and contrib modules (check extra modules listing from OpenCV documentation) 如果需要主模块和contrib模块,请运行pip install opencv-contrib-python (请参阅OpenCV文档中列出的其他模块)

After trying number of solutions seen online, I was able to resolve the issue. 在尝试了许多在线解决方案后,我得以解决该问题。 conda install opencv worked for me. conda install opencv对我conda install opencv If anyone gets the same issue, refer to this document for reference. 如果任何人遇到相同的问题,请参考本文档以供参考。 It worked for me and hopefully it works for you as well. 它对我有用,希望对您也有用。 The link to the document is: http://mathalope.co.uk/2015/05/07/opencv-python-how-to-install-opencv-python-package-to-anaconda-windows/ 该文档的链接为: http : //mathalope.co.uk/2015/05/07/opencv-python-how-to-install-opencv-python-package-to-anaconda-windows/

Its seems your network is not allowing you to access data from command line, we often see these types of issues when we are using office closed network. 看来您的网络不允许您从命令行访问数据,当我们使用Office封闭式网络时,我们经常会遇到这些类型的问题。

In most cases when we disconnect our machines from office network (or take help from IT team to by pass closed network), pip install starts working. 在大多数情况下,当我们从办公室网络断开机器的连接(或从IT团队寻求帮助以通过封闭的网络)时,pip安装就会开始工作。

Can you check if running " pip install pandas" also gives you same error, if so then its definitely network issue. 您可以检查运行“ pip install pandas”是否也会出现相同的错误吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM