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

Can't install orjson #1031

Open
DensonAbraham opened this issue Nov 28, 2023 · 11 comments
Open

Can't install orjson #1031

DensonAbraham opened this issue Nov 28, 2023 · 11 comments
Labels

Comments

@DensonAbraham
Copy link

Chaquopy version

14.0.2

Relevant parts of your build.gradle file

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.chaquo.python'
}

android {
    namespace 'com.chaquo.myapplication'

    compileSdkVersion 33

    defaultConfig {
        applicationId "com.chaquo.myapplication"
        minSdkVersion 21
        targetSdkVersion 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }
        python {
            buildPython "some path"
//            buildPython "C:/path/to/py.exe", "-3.8"
            pip {
                install "matplotlib"
                install "orjson == 3.8.0"
                install "gradio==2.9.4"

Describe your issue

Hi!

Not able to install orjson which is a dependency of gradio library. I even tried not installing orjson explicitly and still end up with error. I have Rust package manager installed as well and I am able to install it in a conda environment but here it fails during the build process. Is there any alternative than creating the own build? Will I face any issue since this package is rust based if I try to build this package? Any help appreciated!


Collecting orjson
  Using cached orjson-3.9.10.tar.gz (5.4 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Welcome\.conda\envs\anomaly_detection\python.exe' 'D:\cogni_projects\chaquopy-matplotlib\app\build\generated\python\bp\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Welcome\AppData\Local\Temp\tmpipr7kpf8'
         cwd: C:\Users\Welcome\AppData\Local\Temp\pip-install-o44rioi3\orjson
    Complete output (20 lines):
    Checking for Rust toolchain....
    Running `maturin pep517 write-dist-info --metadata-directory C:\Users\Welcome\AppData\Local\Temp\pip-modern-metadata-wbgvplht --interpreter C:\Users\Welcome\.conda\envs\anomaly_detection\python.exe`
    Traceback (most recent call last):
      File "D:\cogni_projects\chaquopy-matplotlib\app\build\generated\python\bp\pip\_vendor\pep517\_in_process.py", line 280, in <module>
        main()
      File "D:\cogni_projects\chaquopy-matplotlib\app\build\generated\python\bp\pip\_vendor\pep517\_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "D:\cogni_projects\chaquopy-matplotlib\app\build\generated\python\bp\pip\_vendor\pep517\_in_process.py", line 133, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "C:\Users\Welcome\AppData\Local\Temp\pip-build-env-duxcj3xa\overlay\Lib\site-packages\maturin\__init__.py", line 187, in prepare_metadata_for_build_wheel
        _output = subprocess.check_output(command)
      File "C:\Users\Welcome\.conda\envs\anomaly_detection\lib\subprocess.py", line 411, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "C:\Users\Welcome\.conda\envs\anomaly_detection\lib\subprocess.py", line 489, in run
        with Popen(*popenargs, **kwargs) as process:
      File "C:\Users\Welcome\.conda\envs\anomaly_detection\lib\subprocess.py", line 854, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "C:\Users\Welcome\.conda\envs\anomaly_detection\lib\subprocess.py", line 1307, in _execute_child
        hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
    FileNotFoundError: [WinError 2] The system cannot find the file specified
    ----------------------------------------
ERROR: Failed to install orjson from https://files.pythonhosted.org/packages/72/75/642688bf5d99131fe8cf603f4ef9f26e4b1c6ed8f7f5c7e6fb31def54fb7/orjson-3.9.10.tar.gz#sha256=9ebbdbd6a046c304b1845e96fbcc5559cd296b4dfd3ad2509e33c4d9ce07d6a1 (from gradio==2.9.4).
For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Chaquopy: Exit status 1


@DensonAbraham
Copy link
Author

Also, if a package is created using the builder, does it package the dependencies as well?

@mhsmith
Copy link
Member

mhsmith commented Nov 28, 2023

Since this package contains Rust code, it would have to be built into a wheel file. Any dependencies would need to be built separately, unless they're pure-Python packages, in which case they can be installed directly from PyPI.

If you'd like to try building this package yourself, the instructions are here. However, our package build tool doesn't currently have working support for Rust – see #1030 for details.

If anyone else wants this package too, let us know by clicking the thumbs-up button above.

@DensonAbraham
Copy link
Author

Thanks @mhsmith !

@DensonAbraham
Copy link
Author

@mhsmith Does timm also need to wait for the rust support at build? timm requires safetensors as dependency.

@mhsmith
Copy link
Member

mhsmith commented Dec 2, 2023

Any package that uses Rust would have the same problem.

@LineCutFeng
Copy link

oh no....

@OnlinePage
Copy link

Any package that uses Rust would have the same problem.

Any update bro on this?

@mhsmith
Copy link
Member

mhsmith commented Jun 7, 2024

I've decided that maintaining our own separate Android package repository isn't scalable, so I'm working with the BeeWare project (which has a similar repository for iOS) with the aim of helping upstream package developers release their own Android and iOS wheels on PyPI. So I don't have any update right now, but hopefully the situation will get much better over the next 12 months.

@OnlinePage
Copy link

I've decided that maintaining our own separate Android package repository isn't scalable, so I'm working with the BeeWare project (which has a similar repository for iOS) with the aim of helping upstream package developers release their own Android and iOS wheels on PyPI. So I don't have any update right now, but hopefully the situation will get much better over the next 12 months.

So it means now chaquopy will be now discontinued and beeWare will be now active 🤔?

@mhsmith
Copy link
Member

mhsmith commented Jun 10, 2024

Not at all: I was only talking about the package repository. I'm not focusing on that anymore, because helping package developers build and release their own Android wheels on PyPI is a more efficient use of my time, which will result in many more packages being available in the long run.

But even once Android wheels start appearing on PyPI, I'm sure there will still be important gaps for a long time, so I will still accept and release any good-quality package PRs. I just mostly won't be doing the work myself.

@OnlinePage
Copy link

Hmmm got it!! I appreciate your decision. This will indeed in future increase numbers of available packages Android compatible.

Btw thanks a lot !! Your work Chaquopy helps a lot for devs like us!!!

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

4 participants