Pycharm can run my opencv code but phyton won't respond

It is basically what I wrote on the title. Pycharm can run the code but Python doesn't respond and won't show my live cam feed.

0
9 comments

I also happens when I want to see a picture or play a video from PyCharm.

0

Does it happen only when you run your code from PyCharm?

Have you tried running it from the system terminal using the same command that PyCharm runs?

0

It happens when I run the code from PyCharm. I tried running the same code on IDLE and it runs.

 

I tried running it from the system terminal using the same commands and it runs.

0

Is it reproducible with any code or only when working with opencv?

If latter, could you share a code sample? I'd like to try it in my environment.

0

It is not only camera for me, python basically doesn't even show image(doesn't respond).

from cv2 import cv2 as cv

img = cv.imread("Photos/cat_large.jpg")
cv.imshow("cat", img)
cv.waitKey(0)

0

What PyCharm and macOS versions do you use?

Could you create a new project with a new virtualenv, install opencv and try reproducing the problem? What's the result?

0

PyCharm 2020.2.4 (Professional Edition)
Build #PY-202.8194.15, built on November 25, 2020
Licensed to "my name and surname"
Subscription is active until "date"
For educational use only.
Runtime version: 11.0.9+11-b944.49 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 990M
Cores: 4
Non-Bundled Plugins: com.jetbrains.intellij.datalore

Your Mac is up to date -- macOS Big Sur 11.0.1

Last checked: Today, 17:00

 

 

I made new project and installed opencv again but I got the same error. No luck.

0

Let's do one more test:


Copy the command that PyCharm executes for running your script, paste it to PyCharm's terminal and run. What's the result?

0

No luck unfortunately.

There is a new update, I did it but still, nothing.

0

Please sign in to leave a comment.