I'm working on getting OpenCV-Python installed onto a raspberry pi so that I can stream a video from the pi to my computer. I worked on the code in pycharm and got it to work running the .py files both on my computer, but I have been unable to get the file to work on the pi.
The root cause, I think, is that the OS on the pi is old. It's running python3.4 as the default, with pip 1.5 (I think that's right, its been a minute since I checked). When I attempted to run the program the first time, I got the 'no module cv2' error. Fair enough. Tried pip installing OpenCV-Python and everything has been a mess since then. That pip install fails, updating pip breaks pip, I think because python3.4 reached EOL a while ago, so that's a no go. I've tried installing different versions of Python, lots of different things.
Currently, I've got Python 3.6.5 installed. I ran the command to pip install OpenCV-Python there and the pi has been stuck on 'installing build dependencies' for over two hours now.
I realize this has been all over the place, so here's a hopefully concise question.
What do I need to do to get OpenCV-Python running on my raspberry pi?
Do I need a different version of Python? Of Pip? Dependencies? I think NumPy is the only one but I could be wrong. The possibly dumber question, this is possible, right?
A little extra tidbit, the end goal of this is for work, so I have to stay on the same OS image basically. I can install new libraries and versions of Python, but I can't upgrade entirely.
Sorry that this question is so scattered, yeesh. I'm happy to answer questions about the system etc.
the open cv in raspberry pi is a bit tricky. You need to setup the environment for open-cv to function correctly
try checking this link its work for me
https://www.learnopencv.com/install-opencv-4-on-raspberry-pi/
PS. Read the comment first the code has some error
Related
So basically I don't know how to use pyenv so i just download modules directly. This time I was trying to install matplotlib when I interrupted the process by CTRL-C since it was just showing the progress bar at full but doing nothing.
Then I tried to install again, with pip3 install matplotlib.py.
It ran the cached-matplotlib. Then this happened.
I've tried uninstalling it but it doesn't exist, I've also tried restarting my laptop but it didn't do anything.
I've searched online for the past 1 hour now and no answer at all.
If there's really no way then I guess I'll trying using pyenv(that's what it's for right?).
(I use pip3 because my default built-in python is python2)
Any help is appreciated.
I can see that you are using python 3.9 version. According to matplotlib 3.3.3 the pip command doesn’t support this version yet as of today. So, downgrade your python version to 3.8 may solve the issue. Also, using pyenv to manage your python version would save you those issues in the future.
I am teaching myself python, going through some lessons and reading Al Sweigart's book on programming small video games using Python. I am trying to get Pygame working on my laptop. I have tried time and time again to properly install all neccesary tools to run pygame but for some reason I am constantly unsuccessful.
I first tried to install pygame for python 3.6 and after many different attempts I decided to give my computer a factory reset so I could start clean. I understand I could've deleted all residual files using the terminal but being that I'm an amateur I felt more at ease just giving my mac a wipe. Through my research I found that Pygame works best with python v 2.7. I am running Mac OS 10.13(High Sierra).
The first thing I did upon a fresh wipe was open the terminal and process all commands to download things like python2.7, homebrew, pip, pygame. I then tried to import the pygame module but still no prevail. So I decided to go right to the pygame website and download the, pygame-1.9.2pre-py2.7-macosx10.7, file. I see the pygame folder and all of its contents but everytime I try to import the module I receive this import error:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so: no matching architecture in universal wrapper
I have read that pygame only works with 32 bit version of python but whenever I attempt to download the sole i386/PPC 32 bit version from the website I cant even get IDLE to open at all.
I apologize in advance if my explanation seems a bit choppy. I'm still learning.
Please forget about 32 Bit. Apple is in the process of phasing out support for 32 bit at all, so trying to get something to work there is a short term solution at best.
Also try to not use the shipped Python from Apple. They use it themselves, it's modified slightly from the vanilla one, and fiddling with it might break things.
Your original idea to use python3.6 is the best one. Download and install it, and use the file
https://files.pythonhosted.org/packages/48/d6/230b0d2367824cd51bc9c4baba7e42933c03e34b1ea7ba3812ad5faa4599/pygame-1.9.3-cp36-cp36m-macosx_10_9_intel.whl
to install it using pip.
python3.6 -mpip install pygame
should be enough, the above file is just for reference - it should be picked up by pip.
You should use pip install pygame to install pygame. Then try to run your code by going to proper directory and running python from command line. I tried running my sample pygame code in my IDE VISUAL STUDIO CODE. I kept getting error messages. When I ran same code from command line it worked fine. Also tried from Atom and it worked fine from there too.
No idea why anyone is still messing about with Python 2 that Apple ships. Come on! Python3 has been out for 10 years.
No idea why anyone is installing MS Office or MS Visual Studio on a Mac. Come on! Surely Mac users buy Macs because they want a proper computer.
Just install homebrew, then install Python 3, then install pygame.
Goto homebrew and install it
Then
brew install python
pip install pygame
It seems like a stupidly simple problem, I've installed the youtube-dlg program using pip on MacOS Sierra 10.12.3, got my dependencies in order through some struggling (wxpython3 instead of version 4), etc., and then now that I've gotten to a point where everything seems to be installed where it should be fit to run, I can't seem to figure out how. Here's where I got to.
$ sudo -H pip install youtube-dlg
Requirement already satisfied: youtube-dlg in
/private/var/root/Library/Python/2.7/lib/python/site-packages
My question is, how do I simply run youtube-dlg? The app name and path are listed, and I'm naively stuck on where to go next. This may be a pathing issue I'm not aware of. I was hoping to run it once and find a way to keep it either pinned to the Dock or in Apps seeing as it is a GUI. Getting this to work on windows was easy enough, but unfortunately in the OS world I am master of none, user of many.
Apparently all I needed to do was python youtube-dlg
I am a dummy! For anyone else that might be having troubles with youtube-dlg, make sure you are on wxpython version 3. The current version is 4. Here is a working link for the one I found. https://wxpython.org/snapshots/wxPython3.0-osx-3.0.3.0.b20160914-cocoa-py2.7.dmg
I know this question has been asked a few times before, but none of the answers I've read have managed to solve my problem.
When I try to run any of the following, I get an error saying "pip.exe has stopped working:
easy_install
pip
pip3
It was working for me previously (the last time I used it was probably a month ago), but not anymore. I'm using Python 3.4.4, I checked the PATH and it's configured correctly. Does anyone know what else might be causing the issue?
I had the same problem before and the solution is quite simple.
First try updating pip via command:
pip install --upgrade pip
If that doesn't work try uninstalling current version of python and reinstalling the newest version.
Note1: Do not just delete install files and files in your C drive ,uninstall everything packages, everything that might cause problems, especially delete old python packages and extensions they might not work with the newest python version and that might be the problem. You can see in python website which packages and extensions are supported.
Note2: Do not and I repeat DO NOT install .msi or .exe extensions they don't work anymore always use .whl (wheel) files. If you have one .msi or .exe uninstall them form your system completely; that also means that you have to uninstall them from command prompt.
Note3: Always check if the .whl is compatible with your Python version.
Note4: Also don't forget to save your projects before doing anything.
Hope that works :D
Happy Coding.
Ok, so I spent about 20 hours trying to install pypoker and wxPython in windows and finally gave up. So I installed Ubuntu and got that working. Now, how do i get my Netbeans project to Ubuntu? i straight up copied my src folder in netbeans and put it in ubuntu, but when i typed python "name", all i get is segmentation fault as the output. Is there a simple way to do this, or will i have to go line by line and put it into ubuntu?
Start by installing netbeans Install netbeans http://bit.ly/software-large and go from there.
Not sure of the exact dependencies, but try installing python-wxgtk2.8 (or 2.6) and wx-common (and possibly python-wxtools) if you haven't.