codelv / enaml-native

Build native mobile apps in python with enaml
https://codelv.com/projects/enaml-native/
MIT License
259 stars 21 forks source link

Thirdparty libs use #66

Closed mouEsam closed 6 years ago

mouEsam commented 6 years ago

So I've been trying to use numpy for 3 days with no luck whatsoever I added it to the requirements then 'enaml-native install numpy' then tried linking it "enaml-native link numpy" the tried building but no luck every time the apk gives an error that no module numpy is found I'd like to know how to include it in my apk Thanks in advance

frmdstryr commented 6 years ago

Use enaml-native install android-numpy from the codelv channel. You may need to specify the channel with -c codelv

See https://anaconda.org/codelv/repo for the available packages

mouEsam commented 6 years ago

And write 'numpy' or 'android-numpy' in the requirements??

frmdstryr commented 6 years ago

It would be android-numpy. Currently the build system doesn't really use the packages specified in environment.yaml.

Instead it uses whatever android specific packages are installed in the venv (those under venv/android/<arch> ).

frmdstryr commented 6 years ago

The environment.yaml is more or less used to share/recreate the env on another system.

mouEsam commented 6 years ago

So no real way to exclude modules or packages???

frmdstryr commented 6 years ago

You can include any package, but it must be "built" for android first. There are many packages in https://github.com/codelv/conda-mobile that demonstrate how to do this.

mouEsam commented 6 years ago

Sorry I meant excluding not including "So no real way to exclude modules or packages???"

frmdstryr commented 6 years ago

Sorry I thought it was a typo.

If you want to exclude a module, package, or library you can add a pattern under the excluded section in environment.yaml

See the comments and others listed there as examples. https://github.com/codelv/enaml-native-cli/blob/master/enamlnativecli/templates/app/%7B%7Bcookiecutter.project_name%7D%7D/environment.yml

You can verify this by looking at the .tar.gz file copied into the apps assets folder.

The part of the command that does this is https://github.com/codelv/enaml-native-cli/blob/dbd4befb48db86a87fc36c409001faa7c16f8dd3/enamlnativecli/main.py#L640

mouEsam commented 6 years ago

Well thank you for your time I really appreciate it