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

come.chaquo.python.PyException: PermissionError: [Errno 13] Permission denied: 'convert' #346

Closed
yagneshshinde opened this issue Jul 18, 2020 · 7 comments
Labels

Comments

@yagneshshinde
Copy link

I am using neurokit2-0.0.39-py2.py3-none-any.whl file . After import neurokit2 as no it is giving following error. I have set Storage/Internet permission in Android Manifest. Can you please help us what permission require for 'Convert' or any other solution.

StackTrace :
come.chaquo.python.PyException: PermissionError: [Errno 13] Permission denied: 'convert'
. at .subprocess._execute_child(subprocess.py:1702)
at .subprocess.init(subprocess.py:854)
. at .subprocess.run(subprocess.py:489)
at .subprocess.check_output(subprocess.py:411)
. at .matplotlib.impl(init.py:323) ....

@mhsmith
Copy link
Member

mhsmith commented Jul 18, 2020

This partial stack trace isn't enough to understand what's happening. Please post the full stack trace.

@yagneshshinde
Copy link
Author

yagneshshinde commented Jul 19, 2020

Please find full stack trace

 com.chaquo.python.PyException: PermissionError: [Errno 13] Permission denied: 'convert'
        at <python>.subprocess._execute_child(subprocess.py:1702)
        at <python>.subprocess.__init__(subprocess.py:854)
        at <python>.subprocess.run(subprocess.py:489)
        at <python>.subprocess.check_output(subprocess.py:411)
        at <python>.matplotlib.impl(__init__.py:323)
        at <python>.matplotlib._get_executable_info(__init__.py:385)
        at <python>.matplotlib.animation.bin_path(animation.py:724)
        at <python>.matplotlib.animation.isAvailable(animation.py:427)
        at <python>.matplotlib.animation.isAvailable(animation.py:730)
        at <python>.matplotlib.animation.wrapper(animation.py:120)
        at <python>.matplotlib.animation.<module>(animation.py:737)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.complexity.complexity_embedding.<module>(complexity_embedding.py:2)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.complexity.complexity_delay.<module>(complexity_delay.py:13)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.complexity.<module>(__init__.py:4)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.hrv.hrv_nonlinear.<module>(hrv_nonlinear.py:8)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.hrv.hrv.<module>(hrv.py:8)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.hrv.<module>(__init__.py:2)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.ecg.ecg_intervalrelated.<module>(ecg_intervalrelated.py:5)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.ecg.ecg_analyze.<module>(ecg_analyze.py:5)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.ecg.<module>(__init__.py:5)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.bio.bio_analyze.<module>(bio_analyze.py:5)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.bio.<module>(__init__.py:3)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.neurokit2.<module>(__init__.py:6)
        at <python>.java.chaquopy.import_override(import.pxi:26)
        at <python>.value.<module>(value.py:5)
        at <python>.importlib._bootstrap._call_with_frames_removed(<frozen importlib._bootstrap>:219)
        at <python>.importlib._bootstrap_external.exec_module(<frozen importlib._bootstrap_external>:783)
        at <python>.java.android.importer.exec_module(importer.py:521)
        at <python>.java.android.importer.exec_module(importer.py:566)
        at <python>.importlib._bootstrap._load_unlocked(<frozen importlib._bootstrap>:671)
        at <python>.importlib._bootstrap._find_and_load_unlocked(<frozen importlib._bootstrap>:975)
        at <python>.importlib._bootstrap._find_and_load(<frozen importlib._bootstrap>:991)
        at <python>.importlib._bootstrap._gcd_import(<frozen importlib._bootstrap>:1014)
        at <python>.importlib.import_module(__init__.py:127)
        at <python>.chaquopy_java.Java_com_chaquo_python_Python_getModule(chaquopy_java.pyx:154)
        at com.chaquo.python.Python.getModule(Native Method)

@mhsmith
Copy link
Member

mhsmith commented Jul 20, 2020

I can't reproduce this problem. Does it happen on all devices and emulators? If not, which ones does it happen on?

And have you attempted to provide the "convert" program yourself?

@mhsmith
Copy link
Member

mhsmith commented Jul 20, 2020

Actually sorry, I can reproduce it now, but only on a physical device, not an emulator.

I'll look into it and see if I can come up with a workaround.

@mhsmith
Copy link
Member

mhsmith commented Jul 20, 2020

I think it's caused by inaccessible directories on the PATH. Try running this code before you import neurokit2 or matplotlib:

import os
os.environ["PATH"] = ":".join([p for p in os.environ["PATH"].split(":")
                               if os.access(p, os.R_OK | os.X_OK)])

@mhsmith mhsmith added the bug label Jul 23, 2020
@audvi
Copy link

audvi commented Oct 1, 2020

It worked for me, Thank you !

@mhsmith
Copy link
Member

mhsmith commented Nov 6, 2020

This issue is fixed in Chaquopy 9.0.0. To upgrade, edit your app's top-level build.gradle file and change the version number of com.chaquo.python:gradle.

@mhsmith mhsmith closed this as completed Nov 6, 2020
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