Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import ephem python library #78

Closed
PhilippeDou opened this issue Jan 6, 2019 · 10 comments
Closed

import ephem python library #78

PhilippeDou opened this issue Jan 6, 2019 · 10 comments
Labels

Comments

@PhilippeDou
Copy link

Dear when i put install "ephem" in build.gradle app :

    _python {
        // If Chaquopy fails to find Python on your build machine, enable the following
        // line and edit it to point to a Python 3.4+ executable.
        // buildPython "C:/Python36/python.exe"

        staticProxy "calendrierchinois"
        extractPackages "Data"
        extractPackages "Xml"
        pyc {
            stdlib true
        }
        pip {
            install "ephem"
            install "pytz"
            install "jdcal"

        }
    }
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}_

I have an error when android studio compile code :

_building 'ephem._libastro' extension
error: CCompiler.compile: Chaquopy cannot compile native code


ERROR: Failed to install ephem from https://files.pythonhosted.org/packages/c3/2c/9e1a815add6c222a0d4bf7c644e095471a934a39bc90c201f9550a8f7f14/ephem-3.7.6.0.tar.gz. For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Chaquopy: Exit status 1
:app:generateDebugPythonRequirements FAILED

FAILURE: Build failed with an exception._

@mhsmith
Copy link
Member

mhsmith commented Jan 6, 2019

Thanks for the report, we'll look into it.

@mhsmith
Copy link
Member

mhsmith commented Jan 6, 2019

We've added the package to our repository, so it should work now.

@amjidkhanmohmand
Copy link

when I try to install biosppy library I get the same error as mentioned above by the other user

@mhsmith
Copy link
Member

mhsmith commented Mar 6, 2020

Please post the full build log.

@amjidkhanmohmand
Copy link

Thanks but the issue is resolved. The only issue remained is the size of the app i.e. when I install libraries, the size of the app increases and affects the performance as the app which I am going to deploy will run on different devices having different specifications. So, my question is how to reduce the size of the App?

@mhsmith
Copy link
Member

mhsmith commented Mar 10, 2020

The simplest way to shrink the app is to reduce the number of ABIs, as described in the documentation here.

For example, if you're releasing the app on Google Play, then you can include armeabi-v7a and arm64-v8a, and omit the x86 ABIs. Or if you're only using it on a small selection of devices which you control, you could reduce it to armeabi-v7a only, or arm64-v8a only if your devices are new enough.

@amjidkhanmohmand
Copy link

amjidkhanmohmand commented Mar 11, 2020

[Moved to #238]

@amjidkhanmohmand
Copy link

amjidkhanmohmand commented Mar 12, 2020

`import matplotlib.pyplot as plt
from biosppy import storage
from biosppy.signals import ecg

def test():
x=[1,2,3,4]
y=[4,3,2,1]
plt.plot(x,y)
plt.show()
return "Hello World with Chaquopy"

def ecgAlgo():
i=0
x,y=[],[]
fl=open('Mehran.txt','r')
for l in fl:
if(l!="\n"):
y.append(int(l))
x.append(i)
i+=1
fl.close()
y=y[10:]
out = ecg.ecg(signal=y[:1200], sampling_rate=100., show=False)
return out['rpeaks']`

I had written the above code but when i launch the app it exits with an error

@mhsmith
Copy link
Member

mhsmith commented Mar 12, 2020

Please create separate issues for separate problems. And include the full error message and stack trace, which you can probably find in the Logcat.

@amjidkhanmohmand
Copy link

Ok thanks for your support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants