Recently I've been working on a project that involves a phone taking a picture, processing it in some way, and returning the output on the screen. In order to do this, I would have to use openCV, but when I try to "import cv2" in the Kivy code using the launcher, the app crashes immediately after I run it. I realize now that the reason this happens is because the Kivy launcher by itself can only do basic functions like print and such and there must be extra steps needed to use external libraries. I tried to use Buildozer to create a package for android, but soon found out that it only would work for linux computers, while I use Windows.
Essentially, my question is: Is there any way to include an external library in Kivy without using buildozer? And if there is, could you please describe it or post a link to a webpage that contains instructions(as I am fairly new to programming and am somewhat of a noob)
Thanks!
You can try python-for-android.
But the easiest way - install virtual box to your PC, download kivy/buildozer for VirtualBox( it calles Virtual Machine (for Android/buildozer)) here below: https://kivy.org/#download and then just connect downloaded vmdk-disk to VirtualBox, and then use this. Everything is prepared, you don't need to install kivy or buildozer.
You will spend about 30-40 minutes.
Related
I'm interested in creating a tournament template in excel using python, but I don't expect all my users to have python installed. Is there a way to achieve this? Or is there some other easy-to-use gui that would be suitable for something like this? I've looked at addins using PyXLL and such but they seem to require all users to have them installed.
you can try creating a application in pyqt5 and then create exe of that script using pyinstaller
1- Use pip install pyinstaller
2- pyinstaller -onfile yourcode.py
3- this command will create yourcode.exe
yourcode.exe will run on all the machines either python is installed or not
Implement your tournament template generator application as a web application which runs on a server. Then you can use whatever you like to develop it, and your users don't need more than a web browser to run it.
Recently I followed a Kivy tutorial, and I made a calculator. I then wanted to use it on my phone, so I used Kivy Launcher. The problem is, it only uses Python 2, which for some reason, didn't have support for Unicode characters. Also, a lot of the syntax was very different, so I had to change a lot of the code. Just so I could test it out on my phone.
Is there a Python 3 version for the Kivy Launcher? I've seen things like https://github.com/kivy/python-for-android/issues/1638 but how do you build it? I've ran setup.py and I got a .egg file. What do I do with it? Do I have to make an APK using python-for-android or buildozer?
Also, a lot of the syntax was very different
I think it would be more accurate to say that a small amount of the syntax was somewhat different.
The problem is, it only uses Python 2, which for some reason, didn't have support for Unicode characters
Python 2 did have support for unicode characters, although the subtleties around how they're handled are one of the real differences between Python 2 and 3.
Is there a Python 3 version for the Kivy Launcher?
It's possible to build a Python 3 version of the old launcher, or the new one that you've found. However, in both cases if you can build the launcher you could also just build a standalone apk, so you probably may as well follow the instructions to build your own app with buildozer.
I've ran setup.py and I got a .egg file. What do I do with it? Do I have to make an APK using python-for-android or buildozer?
It sounds like you've built a desktop package for the launcher, if you want to build an apk you must indeed use those projects.
I've figured out some ways to achieve what I wanted.
Get Pydroid 3. Install kivy using Pip and just run it.
Use buildozer to build the Kivy Launcher. Then I can test out some code without building it all.
Use VirtualBox to build. Download a version of Ubuntu/Lubuntu and build the APK.
I'm looking for an equivalent Python library that will work when I run my script on Raspberry Pi. I'm under the impression that pywinauto only works on windows machine.
I want to control some inputs to a GUI launched by my script, using my script. Apart from pywinauto I have no idea how to do this. I thought about using command line to control the software directly, but if there is a simpler way I would really appreciate knowing about it.
Thanks for your time.
ATSPI is an Linux accessibility technology to obtain GUI text/rectangle properties programmatically. See how to find and run ATSPI registry daemon and how to enable ATSPI for the most popular types of GUI apps. Usually it's
$ /usr/libexec/at-spi-registryd &
There is a Python bindings for ATSPI. See this answer for details:
How to install pyatspi?
The pyatspi package has too many dependencies like pygobject etc. It also requires some compilation during installation steps. We think this is not user friendly so we decided to use libatspi.so directly (without any dependencies). This work status can be tracked here: https://github.com/pywinauto/pywinauto/pull/449
There is no exact deadline for pywinauto 0.7.0 with this feature (it's a hobby project), but I would say this summer sounds realistic.
Is it possible to use any Python package within a Kivy program, and ultimately running it on an android device? for example - can I use the package "xlrd" or "googlemaps" on Kivy? If the answer is positive, How do I do it? normally I get an error message that says "No module named X".
Thank you.
Yes you can. Just download the package you want to use and place it in the same folder as your main.py. Then import whatever you wish to use from that package. The packages will also work when you deploy the app onto an Android device.
I'm trying to install kivy to make an application for android and ios.
I have installed the portable app as per the website but wanted to have it included in my python Idle.
So I searched and found Kivy-1.8.0.win32-py3.4.exe installs it ontop of your python instalation (C:\python34)
When i try and import i can import kivy but it wont let me install App or recognise UIX.
I have looked around and I think that my issue is with pygame, every time i try to install it i get missing files and that is with pip and a pygame-1.9.2a0.win32-py3.2.msi that i found but still nothing!
Also read it might be cython and i installed that too downloading Cython-0.21.1 andtrying to run the instaltion on that.
Is there a way to get this done without a headache?
Do i need kivy to make an app for android and ios or can i use tkinter? (thats works on my pc lol)
please any advice would be great, I have searched but all the information out there is very disjointed and im hoping to find a one stop answer in one of you guys.
thanks
Raif
Do i need kivy to make an app for android and ios or can i use tkinter? (thats works on my pc lol)
You need kivy (or maybe some other python tools, but I don't think any are remotely as good). The android build tools only work on linux or osx, though you can use a virtual machine for it.
If you installed from the popular unofficial windows binaries site, make sure the version matches your python version, and you probably need to get pygame from the same place. I don't know much about this though.
Linux is the best python development environment. Python on Windows is very very buggy with certain packages due to compatibility issue. Many important development packages in python are optimized for Linux. You get rid of all headache by downloading and installing a lightweight Linux like o. So like back box on a virtual machine.
If your goal is a Kivy app for iOS and Android, you have already made several mistakes. The first is that you cannot create an iOS app from any OS except OSX. There's no way around that. The second is that the tools for compiling for Android and iOS only work with Python2.7 currently. You seem to be using Python 3.4.