Kivy buildozer apk created but crashes on android - python

I'm working on an app, and my code works perfectly. I was also able to make the apk. But when I ran it, it didn't work properly. My app uses pygsheets, so I thought that the reason might be some missing requirement, but I'm not sure what it is. Please help. Link to log is here. I'm not very sure how I'm supposed to use this to figure out the problem.
Edit: Using a try except block and writing error to text file I found it to be error message to be no module named google. It was during the import pygsheets statement. Any idea on how to solve this ? I'll add my buildozer.spec file here, so please take a look at my requirements section and tell me if anything is missing. https://drive.google.com/file/d/1OkZuW31ugHWEGn8XbIpQRnlWgBwSPt-M/view?usp=drivesdk. I put all the requirements of pygsheets in, so I don't know what's wrong.

I got it. I first added all the requirements of the pygsheet module which aren't directly shown by pip show. Then I had to specify the version as there are specific version requirements. google-api-python-client had to be version 1.11.0 and six had to be version greater than 1.12.0.

Related

ModuleNotFoundError: No module named 'h5pyViewer'

I have a question regarding h5pyViewer to view h5 files. I tried pip install h5pyViewer but that didn't work. I checked on Google and it states that h5pyViewer does not work for older versions of Python, but that there are a few solutions on GitHub. I downloaded this with pip install git+https://github.com/Eothred/h5pyViewer.git which finally gave me a successful installation.
Yet, when I want to import the package with import h5pyViewer it gave me the following error: ModuleNotFoundError: No module named 'h5pyViewer'. However when I tried to install it again it says:
Requirement already satisfied: h5pyviewer in c:\users\celin\anaconda3\lib\site-packages (-v0.0.1.15)Note: you may need to restart the kernel to use updated packages.
Any ideas how to get out of this loop or in what other way I could access an .h5 file?
There could be so many things wrong so it's hard to say what the problem is.
The actual package import has a lowercase "v": h5pyviewer (as seen in your error message).
Your IDE/python runner may not be using your Conda environment (you can select the environment in VSCode, and if you are running a script in the terminal make sure your Conda env is enabled in that terminal)
The GitHub package might be exported from somewhere else. Try something like from Eothred import h5pyviewer.
Maybe h5pyviewer is not even supposed to be imported this way!
Overall, I don't suggest using this package, it seems like it's broken on Python 3 and not well maintained. The code in GitHub looks sketchy, and very few people use it. A good indicator is usually the number of people that star or use the package, which seems extremely low. Additionally, it doesn't even have a real readme file! It doesn't say how to use it at all. Suggest you try something else like pandas. But if you really want to go with this, you can try the above debugging steps.

Example of jqgrid with python

So I've cloned this
https://bitbucket.org/romildo/django-jqgrid-demo.git
as I am looking for a working example of jqgrid with django.
I've been updating the code (as this seems like it was written for a version 2 of django and I'm workng on 4.1)
I'm completely stumped by the lines
from jqgrid import JqGrid
giving me this error
ModuleNotFoundError: No module named 'jqgrid'
I cannot find a reference to jqgrid within pip and I cannot install one (jqgrid is not a python package)
I understand that jqgrid is a javascript component around jquery but how do I get that to work in Python
I have google for django-jqgrid and on youtube. None of the answers provide enough information to get a simple working example up. There seems to be an assumption that everything is installed and I'd like to understand what is required where and how to reference
What am I missing?
Simply you can install this library:
pip install js.jqgrid
And now your above error will solve

How do I edit a bug in a Python 3 API that I have installed?

I've installed the Podio API for Python 3 and found that it imports urlencode from urllib (from where you apparently would import it in Python 2), instead of urllib.parse (where it seems to be in Python 3), making me unable to do pretty much anything with the API. When I edit the code nothing happens and I'm assuming it's because I've already installed it, so how would I go about fixing that? I've looked around but didn't really find any clear instructions on how to do this.
The podio library for python available on pip doesn't seems to be up to date. The last version from github seem to fix your bug.
You should install it as it is recommanded on the project readme:
pip install -e git+https://github.com/podio/podio-py.git#egg=podio-py
(See this issue)
If it doesn't fix your bug, you should fix it on github and make a pull request. This way you will still be able to upgrade it if there is updates later.

GCloud: can't import datastore

Well I'm trying to use Datastore in a personal project using the Google App Engine. Though, I can't import the datastore module, no matter how hard I try.
I've been using the online console during the whole time (in order to avoid to have to solve problems first on my PC and then on GCloud...)
So, I'm using
from google.cloud import datastore
Unfortunately, that's not working at all. The last error I have is
ImportError: No module named google.protobuf
But before I had things like Can't import Datastore.
What I did was removing the integrality of /lib, and reinstalling every dependancy with pip. Here is my requirements.txt:
# This requirements file lists all third-party dependencies for this project.
#
# Run 'pip install -r requirements.txt -t lib/' to install these dependencies
# in `lib/` subdirectory.
#
# Note: The `lib` directory is added to `sys.path` by `appengine_config.py`.
Flask==0.10
google.cloud==0.25.0
protobuf==3.3.0
(The last line was added to try to resolve the last error I got). Before having this error, I got
Also, a little clarification question: I've seen (while looking for answers) people using gcloud and some using google.cloud. What's the difference? What should I use?
Also, pip show google.cloud shows nothing.
What am I missing?
Thank you
Well, if anyone is wondering, here's how I solved the problem. What fixed it was changing the Flask version to 0.12 (don't know why, but that's what happened).
I deleted lib to be sure I was starting from scratch. Then, I used this requirements.txt file:
Flask==0.12
google-cloud==0.25.0
click==5.1
(click is needed by Flask 0.12).

OSX using swi-prolog pyswip package for python

I was trying to execute a third party prolog program for my research. In the meanwhile, I discovered that it requires the pyswip package to execute, due to the program declaration
from pyswip import Prolog
So, after installing this package following the instructions in the INSTALL file, in the root folder of the pyswip installation, the package still could no be found, as with the output error:
ImportError: Could not find the SWI-Prolog library in this platform. If you are sure it is installed, please open an issue.
So after some investigation, I've discovered that the use of the package from python is called from the core.py file, in my case located at
/Library/Python/2.7/site-packages/pyswip
So analyzing this file I could locate the output error text and conclude that the path was not being found according with the specific line
elif platform == "dar": # Help with MacOS is welcome!!
So I noticed too that comment to help with MacOS. Inside the method that tries to found the path properly
(path, swiHome) = _findSwiplDar()
I noticed two array: one with two candidate names of package names and another with the path's candidates. So I've located the first package name "libswipl.dylib" doing a search on my OSX. Finishing, I've added the specific package path to the path array, and everything is working now.
I know this is not the best solution, but I've discovered how things are working and resolved the issue. If someone knows a better way to configure this kind of library without updating the core.py file, I'll be glad to know ;-)
I hope this helps someone!

Categories

Resources