0

I have python 3.8. While working a new project in PyCharm, there was a problem while importing opencv package. I tried multiple solutions but was unable to fix the issue. Here are the screenshots of the same. Screenshot of command prompt

Screenshot of error

Screenshot of error

2
  • 2
    Please edit your question by replacing screenshots with actual text. Not only do links die, but it poses problems for the visually impaired. Commented Apr 7, 2020 at 13:33
  • I don't really know what the problem here is, but it looks like the next thing to try to be to specify to pycharm that you want the version of opencv that you already do have installed. Commented Apr 7, 2020 at 13:34

1 Answer 1

1

If you are able to install opencv using the command line as showed in the first screenshot, I suggest you to use the same virtualenv (or python interpreter) in PyCharm.

Basically in PyCharm is possible to configure a python interpreter in order to do not install again each package.
I guess that the best approach is to prepare a virtualenv and to use it in PyCharm.

Anyway, to configure the python interpreter in PyCharm you should click on:

File > Settings > Project > Project Interpreter

Here you should be able to see in the top of the window the current python interpreter. To change it, simply click on the gear icon and then on Show all.

If the right one is not present, click on the plus icon and then search it using the Existing environment option.

Note
Looking at your screenshot, seems that you are not using a virtualenv but the system interpreter. If this is correct, when you have to add the new python interpreter, choose the System Interpreter option on the left of the window.

Once added the correct python interpreter, you should be able to import and use opencv in PyCharm.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.