Partage
  • Partager sur Facebook
  • Partager sur Twitter

Installation OpenCV

Sujet résolu
    27 mars 2020 à 19:02:06

    Bonjour à tous, Dans le cadre d'un projet scolaire j'ai besoin d'effectuer une reconnaissance d'images. Pour cela j'ai décidé d'utiliser la bibliothèque OpenCV sous Python. (J'utilise anaconda si ça peut servir.)

    runfile('C:/Users/leots/Documents/1-Scolaire/Prepa SUP/info/sanstitre0.py', wdir='C:/Users/leots/Documents/1-Scolaire/Prepa SUP/info') système -> Windows jeu d'instructions -> 32bit distribution -> 10.0.18362 version python -> 3.7.6

    Pour l'installation j'ai ouvert anaconda prompt et entré la ligne de code relative à l'installation d'open cv :

    conda install -c conda-forge opencv

    Et là c'est le drame, après des heures à tourner, la console me renvoie un flot d'erreurs que je ne comprends pas. Donc voilà si quelqu'un parvient à comprendre ce qui ne marche pas ou a une autre idée pour installer cette bibliothèque ce serait vraiment sympa... ; )

    Le message d'erreur renvoyé par la console est vraiment très long, je peux l'envoyer en intégralité en PJ si besoin, voilà le début :

    (base) C:\Users\leots>conda install -c conda-forge opencv Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. 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 jupyter_core: 0%|▎ | 1/301 [00:04<21:47, 4.36s/it]-Examining python-language-server: 5%|█████ | 16/301 [00:21<05:40, 1.19s/it]-Examining yaml: 6%|██████▊ | 18/301 [00:26<07:30, 1.59s/it]-Examining pyodbc: 9%|█████████▉ | 27/301 [00:47<12:39, 2.77s/it]/Examining sphinxcontrib-jsmath: 11%|██████████▉ | 34/301 [00:57<04:52, 1.10s/it]-Examining pandocfilters: 14%|██████████████▏ | 41/301 [01:24<09:22, 2.16s/it]-Examining zlib: 19%|█████████████████████▍ | 57/301 [01:51<04:48, 1.18s/it]/Examining backports.shutil_get_terminal_size: 20%|████████████████▌ | 60/301 [01:52<04:45, 1.19s/it]\Examining pytest: 22%|████████████████████████▋ | 67/301 [02:45<30:54, 7.92s/it]|Examining qdarkstyle: 24%|█████████████████████████▉ | 73/301 [03:14<16:16, 4.28s/it]|Examining autopep8: 25%|███████████████████████████▌ | 76/301 [03:15<06:50, 1.82s/it]|Examining pycrypto: 26%|███████████████████████████▉ | 77/301 [03:16<05:25, 1.45s/it]|Examining sphinxcontrib-htmlhelp: 26%|████████████████████████▌ | 78/301 [03:16<03:55, 1.06s/it]/Examining babel: 26%|█████████████████████████████ | 78/301 [03:16<03:55, 1.06s/it]-Examining mkl-service: 27%|████████████████████████████▏ | 80/301 [03:17<02:41, 1.37it/s]|Examining sphinx: 28%|██████████████████████████████▌ | 83/301 [03:22<05:19, 1.47s/it]\Examining jupyter_console: 29%|█████████████████████████████▊ | 88/301 [04:21<54:40, 15.40s/it]|Examining libarchive: 30%|████████████████████████████████▎ | 91/301 [04:37<33:03, 9.44s/it]|Examining conda-env: 33%|███████████████████████████████████▏ | 98/301 [04:49<10:12, 3.02s/it]\Examining pandas: 37%|████████████████████████████████████████▌ | 111/301 [04:58<01:53, 1.68it/s]|Examining pycosat: 38%|█████████████████████████████████████████▋ | 115/301 [05:15<10:48, 3.49s/it]-Examining intel-openmp: 39%|████████████████████████████████████████▍ | 117/301 [05:16<06:18, 2.05s/it]\Examining bitarray: 43%|██████████████████████████████████████████████▋ | 130/301 [05:28<01:45, 1.62it/s]-Examining astropy: 44%|███████████████████████████████████████████████▊ | 132/301 [05:28<01:07, 2.50it/s]/Examining ipython_genutils: 46%|█████████████████████████████████████████████▊ | 138/301 [06:22<10:33, 3.89s/it]|Examining vs2015_runtime: 46%|███████████████████████████████████████████████ | 139/301 [06:22<07:26, 2.76s/it]/Examining packaging: 47%|██████████████████████████████████████████████████ | 141/301 [06:22<05:14, 1.96s/it]|Examining libtiff: 49%|█████████████████████████████████████████████████████▏ | 147/301 [07:24<33:26, 13.03s/it]\Examining idna: 50%|████████████████████████████████████████████████████████▌ | 152/301 [07:28<11:55, 4.80s/it]/Examining xlrd: 51%|████████████████████████████████████████████████████████▉ | 153/301 [07:28<08:46, 3.56s/it]\Examining h5py: 53%|███████████████████████████████████████████████████████████▉ | 161/301 [07:42<04:26, 1.90s/it]\Examining matplotlib: 58%|█████████████████████████████████████████████████████████████▎ | 174/301 [07:59<02:16, 1.08s/it]|Examining diff-match-patch: 58%|██████████████████████████████████████████████████████████▍ | 176/301 [08:11<04:58, 2.39s/it]|Examining multipledispatch: 59%|██████████████████████████████████████████████████████████▊ | 177/301 [08:11<03:48, 1.85s/it]/Examining anaconda==2020.02: 60%|███████████████████████████████████████████████████████████▏ | 180/301 [08:12<01:47, 1.12it/s]\Examining icc_rt: 60%|██████████████████████████████████████████████████████████████████▏ | 181/301 [08:12<01:46, 1.12it/s]|Examining argh: 61%|████████████████████████████████████████████████████████████████████▍ | 184/301 [08:13<01:00, 1.94it/s]/Examining sqlite: 63%|█████████████████████████████████████████████████████████████████████▍ | 190/301 [08:16<01:01, 1.81it/s]\Examining python=3.7: 64%|████████████████████████████████████████████████████████████████████▎ | 194/301 [08:28<04:02, 2.27s/it]/Examining wheel: 66%|█████████████████████████████████████████████████████████████████████████▍ | 199/301 [08:31<02:28, 1.45s/it]|Examining conda-verify: 67%|█████████████████████████████████████████████████████████████████████▊ | 202/301 [08:36<02:11, 1.33s/it]\Examining pyzmq: 68%|███████████████████████████████████████████████████████████████████████████▌ | 205/301 [08:37<01:03, 1.51it/s]-Examining flake8: 71%|██████████████████████████████████████████████████████████████████████████████▏ | 214/301 [08:47<01:12, 1.21it/s]\Examining msys2-conda-epoch: 74%|█████████████████████████████████████████████████████████████████████████ | 222/301 [10:26<25:16, 19.20s/it]\Examining backports.functools_lru_cache: 75%|█████████████████████████████████████████████████████████████████▎ | 226/301 [10:27<12:18, 9.85s/it]\Examining importlib_metadata: 77%|███████████████████████████████████████████████████████████████████████████▌ | 232/301 [10:32<02:41, 2.34s/it]-Examining sortedcollections: 78%|████████████████████████████████████████████████████████████████████████████▉ | 234/301 [11:31<01:28, 1.32s/it]\Examining bkcharts: 79%|█████████████████████████████████████████████████████████████████████████████████████▊ | 239/301 [11:57<10:12, 9.88s/it]-Examining lxml: 84%|██████████████████████████████████████████████████████████████████████████████████████████████▌ | 254/301 [12:19<01:09, 1.49s/it]\Examining testpath: 84%|███████████████████████████████████████████████████████████████████████████████████████████▏ | 254/301 [12:21<01:09, 1.49s/it]/Examining tblib: 85%|██████████████████████████████████████████████████████████████████████████████████████████████ | 255/301 [12:21<01:09, 1.51s/it]\Examining sqlalchemy: 87%|███████████████████████████████████████████████████████████████████████████████████████████▉ | 261/301 [12:45<01:57, 2.93s/it]|Examining m2w64-libwinpthread-git: 87%|█████████████████████████████████████████████████████████████████████████████████▎ | 263/301 [12:46<01:07, 1.77s/it]-Examining psutil: 88%|█████████████████████████████████████████████████████████████████████████████████████████████████▏ | 266/301 [12:50<01:12, 2.08s/it]\Examining cytoolz: 92%|████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 278/301 [13:10<00:23, 1.01s/it]\Examining cycler: 95%|████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 286/301 [13:22<00:31, 2.12s/it]|Examining traitlets: 96%|███████████████████████████████████████████████████████████████████████████████████████████████████████ | 290/301 [13:23<00:09, 1.14it/s]-Examining curl: 98%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 294/301 [13:24<00:03, 2.05it/s]/Examining click: 99%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 298/301 [13:24<00:00, 3.27it/s]|Examining conflict for scikit-learn jupyter_core olefile yapf pyyaml pytest-astropy idna pywavelets xlrd astroid sphinxcontrib-devhelp patsy keyring intervaltree anaco-Examining conflict for scikit-learn jupyter_core olefile yapf pyyaml pytest-astropy idna pywavelets xlrd astroid sphinxcontrib-devhelp patsy keyring intervaltree anaco\Examining conflict for scikit-learn jupyter_core olefile yapf pyyaml pytest-astropy idna pywavelets xlrd astroid sphinxcontrib-devhelp patsy keyring intervaltree anaco-Examining conflict for nbconvert ipykernel jupyter_core networkx decorator nbformat notebook qtconsole traitlets ipywidgets anaconda jupyter_console jupyter_client sci|Examining conflict for bokeh anaconda-project watchdog pyyaml dask anaconda-navigator anaconda spyder conda-verify anaconda-client conda-build distributed: 9%| | 28/\Examining conflict for bokeh anaconda-project watchdog pyyaml anaconda-navigator conda anaconda conda-verify ruamel_yaml yaml anaconda-client conda-build distributed: \Examining conflict for pluggy pytest pytest-remotedata python-language-server pytest-astropy pytest-arraydiff pytest-doctestplus anaconda pytest-astropy-header spyder \Examining conflict for pytest pytest-remotedata pytest-astropy pytest-arraydiff pytest-doctestplus anaconda spyder pytest-astropy-header atomicwrites astropy pytest-op/Examining conflict for pytest pytest-remotedata packaging pip pytest-astropy distributed pytest-arraydiff dask sphinx pytest-doctestplus anaconda pytest-astropy-header|Examining conflict for nbconvert pluggy entrypoints pytest pydocstyle python-language-server flake8 path.py jsonschema path spyder importlib_metadata keyring jupyter_c/Examining conflict for urllib3 pyopenssl paramiko cryptography: 24%|██████████████▊ | 71/301 [43:53<1:35:41, 24.96s/it]-Examining conflict for pyopenssl paramiko urllib3 anaconda asn1crypto cryptography: 24%|██████████▎ | 72/301 [43:53<1:39:28, 26.06s/it]|Examining conflict for prometheus_client paramiko spyder: 24%|████████████████▋ | 73/301 [44:21<1:09:38, 18.33s/it]-Examining conflict for bcrypt paramiko anaconda spyder prometheus_client: 25%|█████████████▉ | 76/301 [44:24<41:22, 11.03s/it]-Examining conflict for dask partd toolz anaconda cytoolz scikit-image distributed: 25%|███████████▌ | 76/301 [44:53<41:22, 11.03s/it]-Examining conflict for sphinx anaconda spyder numpydoc imagesize: 26%|███████████████▊ | 78/301 [45:37<1:31:33, 24.63s/it]\Examining conflict for python-language-server ujson anaconda spyder python-jsonrpc-server: 28%|██████████ | 84/301 [48:00<1:20:57, 22.38s/it]-Examining conflict for jedi python-language-server anaconda spyder parso ipython: 28%|████████████▋ | 85/301 [48:29<1:27:23, 24.27s/it]/Examining conflict for python-language-server anaconda spyder flake8: 29%|████████████████▎ | 86/301 [48:58<1:32:02, 25.68s/it]-Examining conflict for pydocstyle python-language-server snowballstemmer sphinx anaconda spyder numpydoc: 30%|██████▏ | 89/301 [50:24<1:38:15, 27.81s/it]\Examining conflict for python-language-server anaconda spyder rope: 33%|███████████████████▏ | 98/301 [54:45<1:38:27, 29.10s/it]/Examining conflict for notebook astroid bokeh anaconda-project terminado tornado spyder singledispatch jupyter_client ipykernel dask python-language-server matplotlib -Examining conflict for pydocstyle python-language-server anaconda spyder: 34%|█████████████████▊ | 103/301 [56:58<1:28:23, 26.79s/it]/Examining conflict for seaborn nbformat python-language-server matplotlib jsonschema nltk jupyterlab_server scikit-image flake8 bokeh: 35%|▎| 104/301 [57:27<1:29:42, |Examining conflict for xlsxwriter anaconda: 35%|████████████████████████████▎ | 104/301 [57:32<1:29:42, 27.32s/it]/Examining conflict for seaborn anaconda-navigator matplotlib matplotlib-base imageio pillow nltk anaconda scikit-image freetype bokeh: 37%|▎| 112/301 [1:00:19<1:29:52|Examining conflict for seaborn statsmodels anaconda: 38%|███████████████████████████▏ | 115/301 [1:02:10<1:43:31, 33.39s/it]|Examining conflict for anaconda-project pandas seaborn distributed dask pytz anaconda-navigator statsmodels matplotlib bkcharts sphinx nltk anaconda scikit-image babel|Examining conflict for pandas notebook spyder-kernels statsmodels bkcharts anaconda-client bokeh anaconda-project python-dateutil jupyter_console jupyter_client scikit\Examining conflict for bokeh seaborn dask matplotlib nltk anaconda scikit-image distributed: 39%|████████████▏ | 118/301 [1:04:54<2:07:30, 41.81s/it]|Examining conflict for libxslt libxml2 bokeh zstd h5py python-libarchive-c opencv scikit-image freetype pytables libarchive lxml libpng matplotlib matplotlib-base qt n-Examining conflict for anaconda-project anaconda-navigator conda anaconda ruamel_yaml anaconda-client conda-build: 42%|███▋ | 125/301 [1:09:27<2:00:03, 40.93s/it]\Examining conflict for xmltodict anaconda-navigator: 46%|████████████████████████████████▌ | 138/301 [1:16:15<1:22:51, 30.50s/it]/Examining conflict for openpyxl anaconda jdcal: 48%|█████████████████████████████████████▌ | 145/301 [1:18:05<57:06, 21.96s/it]/Examining conflict for ipykernel backcall ipywidgets anaconda jupyter_console ipython: 51%|███████████████████▉ | 154/301 [1:21:27<59:21, 24.23s/it]-Examining conflict for ipykernel jupyter pyreadline h5py ipywidgets anaconda jupyter_console ipython: 52%|███████████▍ | 156/301 [1:22:24<1:03:18, 26.20s/it]/Examining conflict for pytest conda-build testpath pickleshare importlib_metadata ipython pathlib2: 53%|█████████████▋ | 159/301 [1:23:20<51:13, 21.64s/it]\Examining conflict for libxslt libarchive lxml anaconda libxml2 libiconv: 53%|███████████████████████████▋ | 160/301 [1:23:48<35:53, 15.27s/it]/Examining conflict for sphinx sphinxcontrib-jsmath anaconda spyder numpydoc: 54%|██████████████████████████▎ | 162/301 [1:24:44<49:52, 21.53s/it]|Examining conflict for sphinx anaconda spyder numpydoc babel: 55%|██████████████████████████████████▏ | 166/301 [1:26:39<1:00:46, 27.01s/it]|Examining conflict for sphinxcontrib-websupport sphinx anaconda spyder numpydoc: 56%|████████████████████████▎ | 170/301 [1:28:50<1:12:01, 32.99s/it]\Examining conflict for bokeh dask anaconda scikit-image distributed: 58%|████████████████████████████████▉ | 174/301 [1:29:49<54:39, 25.82s/it]-Examining conflict for bokeh ipykernel anaconda-project terminado notebook matplotlib tornado matplotlib-base jupyterlab jupyter_client distributed: 59%|▌| 177/301 [1\Examining conflict for backports.tempfile conda-verify backports.weakref: 60%|███████████████████████████████▎ | 181/301 [1:32:30<30:30, 15.25s/it]-Examining conflict for nose anaconda: 61%|█████████████████████████████████████████████████████▌ | 183/301 [1:33:27<29:09, 14.83s/it]/Examining conflict for anaconda conda-build liblief py-lief: 63%|████████████████████████████████████████▊ | 189/301 [1:35:55<52:39, 28.21s/it]|Examining conflict for jupyter notebook ipywidgets anaconda jupyterlab_server jupyterlab _ipyw_jlab_nb_ext_conf widgetsnbextension: 67%|▋| 203/301 [1:41:25<40:35, 24.-Examining conflict for jupyter notebook ipywidgets anaconda jupyterlab_server jupyterlab prometheus_client widgetsnbextension: 68%|▋| 204/301 [1:41:53<28:13, 17.45s/i-Examining conflict for wheel pip python anaconda: 74%|████████████████████████████████████████████████████████▌ | 224/301 [1:49:05<38:08, 29.72s/it]\Examining conflict for nbconvert jupyter notebook anaconda spyder pandoc: 79%|█████████████████████████████████████████ | 238/301 [1:55:21<29:18, 27.91s/it]|Examining conflict for watchdog anaconda spyder pathtools: 79%|█████████████████████████████████████████████████████▏ | 239/301 [1:56:21<29:34, 28.62s/it]-Examining conflict for argh watchdog anaconda spyder: 81%|██████████████████████████████████████████████████████████▏ | 243/301 [1:57:47<27:58, 28.93s/it]-Examining conflict for m2w64-gcc-libs-core m2w64-libwinpthread-git pywinpty anaconda m2w64-gcc-libgfortran msys2-conda-epoch m2w64-gcc-libs m2w64-gmp: 82%|▊| 248/301 \Examining conflict for fastcache sympy anaconda: 88%|████████████████████████████████████████████████████████████████████ | 266/301 [2:07:22<12:48, 21.96s/it]-Examining conflict for mpmath sympy: 88%|██████████████████████████████████████████████████████████████████████████████▋ | 266/301 [2:07:50<12:48, 21.96s/it]|Examining conflict for fsspec dask anaconda scikit-image distributed: 89%|██████████████████████████████████████████████████ | 269/301 [2:08:18<11:02, 20.70s/it]\Examining conflict for scikit-image anaconda: 91%|████████████████████████████████████████████████████████████████████████▌ | 273/301 [2:11:08<14:00, 30.02s/it]|Examining conflict for dask scikit-image anaconda distributed: 91%|█████████████████████████████████████████████████████████▎ | 274/301 [2:11:36<13:09, 29.23s/it]|Examining conflict for conda-package-handling python-libarchive-c conda anaconda conda-verify conda-build: 98%|██████████████████▌| 294/301 [2:20:57<03:20, 28.58s/it]|Examining conflict for path.py anaconda: 98%|███████████████████████████████████████████████████████████████████████████████████▌ | 296/301 [2:21:52<02:20, 28.10s/it]\Examining conflict for pycurl anaconda: 99%|████████████████████████████████████████████████████████████████████████████████████▊ | 297/301 [2:22:19<01:18, 19.73s/it]\Examining conflict for beautifulsoup4 anaconda conda-build: 100%|██████████████████████████████████████████████████████████████████| 301/301 [2:24:10<00:00, 25.68s/it]\failed | /

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

    • Partager sur Facebook
    • Partager sur Twitter
      27 mars 2020 à 21:16:50

      Essai voir opencv3 au lieu de opencv
      • Partager sur Facebook
      • Partager sur Twitter

      Celui qui trouve sans chercher est celui qui a longtemps cherché sans trouver.(Bachelard)
      La connaissance s'acquiert par l'expérience, tout le reste n'est que de l'information.(Einstein)

        29 mars 2020 à 23:13:00

        Salut, merci pour ta réponse Je viens d'essayer mais malheureusement ça ne marche pas, le module opencv3 ne semble pas exister...

        Le problème pourrait-il venir de mon ordi avec, une fonction mal paramétrée ou quelque chose du genre ?

        (base) C:\Users\leots>conda install -c conda-forge opencv3 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.

        PackagesNotFoundError: The following packages are not available from current channels:

        • opencv3

        Current channels:

        To search for alternate channels that may provide the conda package you're looking for, navigate to

        https://anaconda.org
        

        and use the search bar at the top of the page.

        • Partager sur Facebook
        • Partager sur Twitter
          30 mars 2020 à 23:59:05

          Alors tu peux utiliser un fichier wheel se trouvant ICI

          Après il suffira de faire un pip install file.whl

          où file sera l'endroit où tu as stocké ton fichier wheel.

          • Partager sur Facebook
          • Partager sur Twitter

          Celui qui trouve sans chercher est celui qui a longtemps cherché sans trouver.(Bachelard)
          La connaissance s'acquiert par l'expérience, tout le reste n'est que de l'information.(Einstein)

            19 avril 2020 à 18:09:40

            Salut, Un dernier petit message avant de fermer ce chat, Après un certain temps j'ai réussi (enfin) mon installation en entrant tout simplement py -3.7 -m pip install opencv-python

            3.7 étant ma version de python En espérant qu'une des trois commandes proposées ici puissent aider quelqu'un Encore merci pour ton aide

            • Partager sur Facebook
            • Partager sur Twitter
              21 avril 2020 à 20:10:38

              salut j'ai le même problème que toi et après ce que j'ai lu ce doit être un problème d'environnement.... et pares exécution de ton code déjà très difficile a lire,(

               pip install opencv-python


              ) voici ce que j'ai sur la console 

               Downloading opencv_python-4.2.0.34-cp37-cp37m-win_amd64.whl (33.0 MB)



              mais le problème c'est que je suis sur python 3 et pas 4  merci d'avance 

              -
              Edité par Freddy Donald 21 avril 2020 à 20:13:11

              • Partager sur Facebook
              • Partager sur Twitter

              tout ce qui brille n'est pas or !!! http://wandablog.com

              Installation OpenCV

              × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
              × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
              • Editeur
              • Markdown