0

I have been trying for the past half hour to install the cv2 package using the conda commands, but it doesn't work at all. I have found a stackoverflow post listing 5 conda install -c conda-forge commands, but they don't work. The prompt get's stuck at "Solving environment: " where it runs quite a bit before giving an error: "failed with initial frozen solve. Retrieving with flexible solve".

Long story short, it doesn't install. What else can I do? I need this package for an assignment. P:S I haven't tried with pip install. It doesn't recognize pip as a command and honestly I got lost trying to figure that out.

Many thanks

I tried creating a new environments, and it gets a little further, but I get this error: enter image description here

LCh
  • 9
  • 5
  • 1
    Did you create a specific environment ? It seems to solve your problem https://stackoverflow.com/questions/57518050/conda-install-and-update-do-not-work-also-solving-environment-get-errors – Alexy May 04 '20 at 11:42
  • Hey, thanks for the suggestion. It works well for a bit, proceeds to install but then I get another error (any idea how I can post a picture?). Preparing transaction: done Verifying transaction: done Executing transaction: done ERROR conda.core.link:_execute(700): An error occurred while installing package 'conda-forge::qt-5.12.5-h7ef1ec2_0'. Rolling back transaction: done LinkError: post-link script failed for package conda-forge::qt-5.12.5-h7ef1ec2_0 location of failed script: C:\Users\Lucian\Anaconda3\envs\myenv\Scripts\.qt-post-link.bat ... – LCh May 04 '20 at 12:00
  • You can edit your initial post. Honestly, most problems related to anaconda can "easily" be resolved by re-install conda or trying to conda clean in your environment (as your problem seems to be specific to your configuration) – Alexy May 04 '20 at 12:32
  • I did reinstall anaconda, but I get the exact same errors as before. I posted a pic in my original post. – LCh May 04 '20 at 12:59
  • what is your command ? And do you have "C:\Windows\system32" in your path ? (cmd SET PATH). Try to check if "where chcp" command give you some results – Alexy May 04 '20 at 13:02
  • I did: conda install -c conda-forge opencv if I write where chcp it says "where is not recognized as an internal or external command" – LCh May 04 '20 at 13:10
  • Ok so your problem is definitly not associated to anaconda but your setup and especially your system PATH. You have to check your global variables – Alexy May 04 '20 at 13:13
  • Huh, I really have no idea what that is and how I do that. Would you please elaborate the steps? Many thanks – LCh May 04 '20 at 13:15
  • the global variables are a set of link in which your command window will search for commands. For example, when you ask for "where chcp", your command prompt will search in the global variables how to execute the "where" command. But it seems that in your case, your prompt don't know where is it. I think that is because your global variables don't indicates your prompt where the command is. I think that because your error "chcp is not recognize" is the same scerio where your global variable can't find "chcp" command, and the same for you "pip install". To confirm this hypothesis, type SET PATH – Alexy May 04 '20 at 13:23
  • may try https://superuser.com/questions/523688/how-to-restore-the-path-environment-variable-i-deleted – Alexy May 04 '20 at 13:27
  • if I type "set path" it gives me a long list of paths. I looked at the link provided but I don't really understand. What should be the correct path? – LCh May 04 '20 at 13:32
  • chcp is in C:\Windows\System32 so you should at least have this to resolve your problem with conda install – Alexy May 04 '20 at 13:42
  • ok, so I added that path to the lists of paths. And now it seems it worked, as in I didn;t get any errors (still had to conda create a new environment). The problem is when I write import cv2 in my jupyter console, it says no such module exists. – LCh May 04 '20 at 13:57
  • you can check if it's installed with conda list command. For the rest, I didn't use CV since last years so I can't recall every steps to import it in your project – Alexy May 04 '20 at 14:08
  • it is installed in this new environment. Could it have sth. to do with the fact that it is in this new environment? If so, how do I fix it – LCh May 04 '20 at 14:14
  • Nvm, I think it somehow worked in the end....no idea why or how... Many thanks for your patience and help! – LCh May 04 '20 at 14:42

0 Answers0