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

Android Studio Gradle Sync issue #101

Closed
GoddessAphrael opened this issue Mar 30, 2019 · 6 comments
Closed

Android Studio Gradle Sync issue #101

GoddessAphrael opened this issue Mar 30, 2019 · 6 comments
Labels

Comments

@GoddessAphrael
Copy link

GoddessAphrael commented Mar 30, 2019

Trying to import requirements for https://github.com/githubharald/SimpleHTR which can be viewed at https://github.com/githubharald/SimpleHTR/blob/master/requirements.txt

> Task :app:generateDebugPythonRequirements
Chaquopy: Installing for arm64-v8a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-2.1
Collecting absl-py==0.7.0
  Using cached https://files.pythonhosted.org/packages/31/bc/ab68120d1d89ae23b694a55fe2aece2f91194313b71f9b05a80b32d3c24b/absl-py-0.7.0.tar.gz
Collecting astor==0.7.1
  Downloading https://files.pythonhosted.org/packages/35/6b/11530768cac581a12952a2aad00e1526b89d242d0b9f59534ef6e6a1752f/astor-0.7.1-py2.py3-none-any.whl
Collecting editdistance==0.5.2
  Downloading https://files.pythonhosted.org/packages/07/61/9fac12e2688bc59d8b6a575e952826d93120e44d8db1bb7fe6c60e6994a1/editdistance-0.5.2.tar.gz
Collecting gast==0.2.2
  Downloading https://files.pythonhosted.org/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz
Collecting grpcio==1.18.0
  Downloading https://files.pythonhosted.org/packages/90/2e/f432e69f86961393c22a6c4490aafdbb94533deba33f5ea2d5651770aa21/grpcio-1.18.0.tar.gz (14.6MB)
Collecting h5py==2.9.0
  Downloading https://files.pythonhosted.org/packages/43/27/a6e7dcb8ae20a4dbf3725321058923fec262b6f7835179d78ccc8d98deec/h5py-2.9.0.tar.gz (287kB)
Collecting Keras-Applications==1.0.7
  Downloading https://files.pythonhosted.org/packages/90/85/64c82949765cfb246bbdaf5aca2d55f400f792655927a017710a78445def/Keras_Applications-1.0.7-py2.py3-none-any.whl (51kB)
Collecting Keras-Preprocessing==1.0.8
  Downloading https://files.pythonhosted.org/packages/14/8d/443591dd9f42cdde966a14ea2d59e7a781b77a8f09652288af61bec93b81/Keras_Preprocessing-1.0.8-py2.py3-none-any.whl (59kB)
Collecting Markdown==3.0.1
  Downloading https://files.pythonhosted.org/packages/7a/6b/5600647404ba15545ec37d2f7f58844d690baf2f81f3a60b862e48f29287/Markdown-3.0.1-py2.py3-none-any.whl (89kB)
Collecting numpy==1.16.1
  Downloading https://files.pythonhosted.org/packages/2b/26/07472b0de91851b6656cbc86e2f0d5d3a3128e7580f23295ef58b6862d6c/numpy-1.16.1.zip (5.1MB)
Collecting opencv-python==4.0.0.21
  Could not find a version that satisfies the requirement opencv-python==4.0.0.21 (from versions: 3.4.2.16)
No matching distribution found for opencv-python==4.0.0.21
Chaquopy: Exit status 1

> Task :app:generateDebugPythonRequirements FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugPythonRequirements'.
> buildPython failed (org.gradle.process.internal.ExecException: Process 'command 'py'' finished with non-zero exit value 1). For full details, open the 'Build' window and switch to text mode with the 'Toggle view' button on the left.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 38s
6 actionable tasks: 1 executed, 5 up-to-date

From https://pypi.org/project/opencv-contrib-python/:

Pip fails with Could not find a version that satisfies the requirement ...?

A: Most likely the issue is related to too old pip and can be fixed by running pip install --upgrade pip. Note that the wheel (especially manylinux) format does not currently support properly ARM architecture so there are no packages for ARM based platforms in PyPI. However, opencv-python packages for Raspberry Pi can be found from https://www.piwheels.org/.

Please advise how to proceed.

@mhsmith
Copy link
Member

mhsmith commented Apr 1, 2019

We don't currently have that exact version of opency-python, but we do have a slightly older version which hopefully will still work. The same will also be true of the packages editdistance, grpcio, h5py, numpy, tensorboard and tensorflow. Try removing the version specifier from these packages, and pip will install the newest version available for Chaquopy.

Also remove the pkg-resources line: this is caused by a bug in the process which created the requirements list.

The resulting list should look like this:

absl-py==0.7.0
astor==0.7.1
editdistance
gast==0.2.2
grpcio
h5py
Keras-Applications==1.0.7
Keras-Preprocessing==1.0.8
Markdown==3.0.1
numpy
opencv-python
protobuf==3.6.1
six==1.12.0
tensorboard
tensorflow
termcolor==1.1.0
Werkzeug==0.14.1

Please give that a try and let me know how you get on.

@mhsmith
Copy link
Member

mhsmith commented Apr 1, 2019

Actually, the tensorboard line should simply be removed. That way, pip will select the version which corresponds with your tensorflow version, rather than the newest one.

@GoddessAphrael
Copy link
Author

Thank you for getting back to me, I have edited the requirements as per your modified list.

The gradle does now build, however, after downloading and collecting all the components, whilst installing for the arm64-v8a abiFilter, I see this line at the end:

tensorflow 1.10.1 has requirement setuptools<=39.1.0, but you'll have setuptools 40.8.0 which is incompatible.

Chaquopy: Installing for arm64-v8a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-2.1
Collecting absl-py==0.7.0
Collecting astor==0.7.1
Using cached https://files.pythonhosted.org/packages/35/6b/11530768cac581a12952a2aad00e1526b89d242d0b9f59534ef6e6a1752f/astor-0.7.1-py2.py3-none-any.whl
Collecting editdistance
Using cached https://chaquo.com/pypi-2.1/editdistance/editdistance-0.5.3-0-cp36-cp36m-android_21_arm64_v8a.whl
Collecting gast==0.2.2
Collecting grpcio
Using version 1.12.1 (newest version is 1.19.0, but Chaquopy prefers native wheels)
Using cached https://chaquo.com/pypi-2.1/grpcio/grpcio-1.12.1-2-cp36-cp36m-android_21_arm64_v8a.whl
Collecting h5py
Using version 2.8.0 (newest version is 2.9.0, but Chaquopy prefers native wheels)
Using cached https://chaquo.com/pypi-2.1/h5py/h5py-2.8.0-0-cp36-cp36m-android_21_arm64_v8a.whl
Collecting Keras-Applications==1.0.7
Using cached https://files.pythonhosted.org/packages/90/85/64c82949765cfb246bbdaf5aca2d55f400f792655927a017710a78445def/Keras_Applications-1.0.7-py2.py3-none-any.whl
Collecting Keras-Preprocessing==1.0.8
Using cached https://files.pythonhosted.org/packages/14/8d/443591dd9f42cdde966a14ea2d59e7a781b77a8f09652288af61bec93b81/Keras_Preprocessing-1.0.8-py2.py3-none-any.whl
Collecting Markdown==3.0.1
Using cached https://files.pythonhosted.org/packages/7a/6b/5600647404ba15545ec37d2f7f58844d690baf2f81f3a60b862e48f29287/Markdown-3.0.1-py2.py3-none-any.whl
Collecting numpy
Using version 1.14.2 (newest version is 1.16.2, but Chaquopy prefers native wheels)
Using cached https://chaquo.com/pypi-2.1/numpy/numpy-1.14.2-1-cp36-cp36m-android_21_arm64_v8a.whl
Collecting opencv-python
Using cached https://chaquo.com/pypi-2.1/opencv-python/opencv_python-3.4.2.16-2-cp36-cp36m-android_21_arm64_v8a.whl
Collecting protobuf==3.6.1
Using cached https://files.pythonhosted.org/packages/77/78/a7f1ce761e2c738e209857175cd4f90a8562d1bde32868a8cd5290d58926/protobuf-3.6.1-py2.py3-none-any.whl
Collecting six==1.12.0
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting tensorflow
Using cached https://chaquo.com/pypi-2.1/tensorflow/tensorflow-1.10.1-7-cp36-cp36m-android_21_arm64_v8a.whl
Collecting termcolor==1.1.0
Collecting Werkzeug==0.14.1
Using cached https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl
Collecting chaquopy-gnustl>=4.9 (from editdistance)
Using cached https://chaquo.com/pypi-2.1/chaquopy-gnustl/chaquopy_gnustl-4.9.3-2-py2.py3-none-android_21_arm64_v8a.whl
Collecting setuptools (from grpcio)
Using cached https://files.pythonhosted.org/packages/d1/6a/4b2fcefd2ea0868810e92d519dacac1ddc64a2e53ba9e3422c3b62b378a6/setuptools-40.8.0-py2.py3-none-any.whl
Collecting chaquopy-hdf5>=1.10.2 (from h5py)
Using cached https://chaquo.com/pypi-2.1/chaquopy-hdf5/chaquopy_hdf5-1.10.2-0-py2.py3-none-android_21_arm64_v8a.whl
Collecting chaquopy-openblas>=0.2.20 (from numpy)
Using cached https://chaquo.com/pypi-2.1/chaquopy-openblas/chaquopy_openblas-0.2.20-2-py2.py3-none-android_21_arm64_v8a.whl
Collecting chaquopy-libpng>=1.6.34 (from opencv-python)
Using cached https://chaquo.com/pypi-2.1/chaquopy-libpng/chaquopy_libpng-1.6.34-0-py2.py3-none-android_21_arm64_v8a.whl
Collecting chaquopy-libjpeg>=1.5.3 (from opencv-python)
Using cached https://chaquo.com/pypi-2.1/chaquopy-libjpeg/chaquopy_libjpeg-1.5.3-0-py2.py3-none-android_21_arm64_v8a.whl
Collecting wheel>=0.26 (from tensorflow)
Using cached https://files.pythonhosted.org/packages/96/ba/a4702cbb6a3a485239fbe9525443446203f00771af9ac000fa3ef2788201/wheel-0.33.1-py2.py3-none-any.whl
Collecting tensorboard<1.11.0,>=1.10.0 (from tensorflow)
Downloading https://files.pythonhosted.org/packages/c6/17/ecd918a004f297955c30b4fffbea100b1606c225dbf0443264012773c3ff/tensorboard-1.10.0-py3-none-any.whl (3.3MB)
Collecting chaquopy-libgfortran>=4.9 (from chaquopy-openblas>=0.2.20->numpy)
Using cached https://chaquo.com/pypi-2.1/chaquopy-libgfortran/chaquopy_libgfortran-4.9.3-7-py2.py3-none-android_21_arm64_v8a.whl
tensorflow 1.10.1 has requirement setuptools<=39.1.0, but you'll have setuptools 40.8.0 which is incompatible.

I don't know if this is going to cause issues, but it was the only thing I was concerned about.

@mhsmith
Copy link
Member

mhsmith commented Apr 1, 2019

It probably won't cause any issues, but you can fix it by adding setuptools==39.1.0 at the top of the list.

@mhsmith mhsmith closed this as completed Apr 2, 2019
@MalikSayriii
Copy link

is it pssible to Use (pip install pyaudio) PyAudio in android studio along with java to make an android app ?
it is installed using Chaquopy ..but while running/building Android studio is giving me errors...

`----------------------------------------
error: CCompiler.compile: Chaquopy cannot compile native code

Command "C:\Users\hp\AppData\Local\Programs\Python\Python38\python.exe -u -S -c "import setuptools, tokenize;file='C:\Users\hp\AppData\Local\Temp\pip-install-tc7l2tl5\PyAudio\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\hp\AppData\Local\Temp\pip-wheel-_2_ripnu --python-tag py3" failed with error code 1 in C:\Users\hp\AppData\Local\Temp\pip-install-tc7l2tl5\PyAudio
ERROR: Failed to install PyAudio from https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz.
For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Failed to install PyAudio from https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz.

Chaquopy: Exit status 1

Task :app:generateDebugPythonRequirements FAILED

Execution failed for task ':app:generateDebugPythonRequirements'.

Process 'command 'C:/Users/hp/AppData/Local/Programs/Python/Python38/python.exe'' finished with non-zero exit value 1

`

@mhsmith
Copy link
Member

mhsmith commented May 11, 2021

See #389 for information about PyAudio.

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