I am trying to use a camera in windows. I ve installed python with anaconda. tried installing pygame with conda but did not work so installed with pip.
Following the advice in open camera with pygame I tried to open the camera but I got an error.
When executing pygame.camera.init() the system complains that can not import name _camera .
Indeed when reading camera.py there is the line from pygame import _camera and this is where it fails. It can not import _camera
I am at lost at what to do. Any help very much appreciated
EDIT1:
I have been told that this works in linux only. :(
So going to the title question: How to use the camera with python in windows? (or mac?)
PyGame Doc: camera
Pygame currently supports only Linux and v4l2 cameras.
It means it works only with Linux.
Related
I'm trying to do some object tracking on a video using Google Colab but I'm facing the issue below. Tracking is only done in the first frame of the video and not in the rest. I'm working with exactly same files and same commands both on my computer and Google Colab.
expected
Google Colab
It seems like TensorFlow's version caused this problem. Here is my solution:
!pip install tensorflow==2.3.0
What i have done is downloaded a already preset skeleton for my dash app using a !wget function in Jupyter Notebook, I was wondering how could i launch the app?
Is there something similar to this line of code i could use python3 spacex_dash_app.py?
Thank you.
The ! symbol passes your commands to the underlying shell running Jupyter.
Similar to prefixing wget with !, you can run !python3 spacex_dash_app.py, after making sure that spacex_dash_app.py is in the same working directory as your Jupyter notebook.
My built-in camera suddenly couldn't be accessed after I installed and executed opencv code on pycharm. I had reseted and deleted pycharm but it was not worked. In device manage i can't find camera drive(but sometime i find it and my camera work properly). I have Matlab on my laptop too I think maybe there are some conflict between apps. Hope someone can help me, thank you guys.
I have an app which was successfully packaged for android using python 2 and buildozer. I ammended the program adding the matplotlib garden module using 'garden install --app matplotlib' into the main app directory. It runs fine on pydroid and ubuntu, but crashes after packaging on android. I've added regular matplotlib python library to requirements in .spec file and tried putting matplotlib into the garden requirements also. Should I not add the garden matplotlib to kivy garden requirements in spec file if the garden module is already installed in the main app dir? Thanks.
I had this same problem and would have dropped kivy altogether, until I caught the workaround described here on github. It's also referenced in comments on this answer here on stackoverflow. As I saw it, the crash occurred due to the statement from kivy.garden.matplotlib import FigureCanvasKivyAgg, and the problem isn't obvious from any of the messages in the android logfiles.
React native documentation says python2 is required but what if python3 is installed?
will I get errors in react native app if python3 is installed?
I am using windows 10 and I am going to run it on Android.
also, I read python is necessary from this question.
Yes. You can work with react native and python 3.
Edit
Now it is mentioned,
Python v2.7, v3.5, v3.6, v3.7, or v3.8
So I believe Python 3 should be good to go.
Old Answer
I would say if they have specifically mentioned Python 2 then there must be some reason. If you go to this link, then you can see they have mentioned
python (v2.7 recommended, v3.x.x is not supported)
So there might be some compatibility issue in some module or something. Just check everything you require is working as expected.