chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
845 stars 133 forks source link

import ephem python library #78

Closed PhilippeDou closed 5 years ago

PhilippeDou commented 5 years ago

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 commented 5 years ago

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

mhsmith commented 5 years ago

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

amjidkhanmohmand commented 4 years ago

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

mhsmith commented 4 years ago

Please post the full build log.

amjidkhanmohmand commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

[Moved to #238]

amjidkhanmohmand commented 4 years ago

`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 commented 4 years ago

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 commented 4 years ago

Ok thanks for your support