Chaquopy无法安装Qiskit

发布于 2025-02-10 10:30:50 字数 874 浏览 3 评论 0原文

您好,我试图用Chaquopy(12.0.0)和Qiskit(0.34.2)构建一个应用程序。 Gradle Sync的发生良好。但是,当我去构建应用程序并将其安装在手机上时。它给出了Qiskit软件包的错误,如错误:命令错误在退出状态1:时错误。另一个软件包安装正常,并且该应用程序正在运行,而其他python函数被称为,只是qiskit给出了问题。

我尝试使用Python 3.8,但给出了相同的错误,我当前的Python版本是3.9

Gradle版本(8.0) 这是我的gradle文件

python {
        buildPython "C:/Program Files/python/python3.8/python.exe"

        pip {
            // A requirement specifier, with or without a version number:
            install "numpy"
            install "qiskit==0.36.2"
            install "matplotlib"

        }
    }

,这是我正在使用的python文件

from qiskit import *
from qiskit.tools.visualization import plot_histogram
from qiskit.tools.visualization import plot_state_qsphere
from qiskit.tools.visualization import plot_bloch_multivector

def bv(num):
    return "test return"

Hello I am trying to build an app with Chaquopy(12.0.0) and qiskit(0.34.2). The gradle sync is happening fine. But when I go and build the app and install it on my phone. it give error for the qiskit package as ERROR: Command errored out with exit status 1:. The other package are installing fine, and the app is running, with other python function being called, just qiskit is giving problem.

I tried to used python 3.8, but gives the same error, my current python version is 3.9

gradle version(8.0)
Here's my gradle file

python {
        buildPython "C:/Program Files/python/python3.8/python.exe"

        pip {
            // A requirement specifier, with or without a version number:
            install "numpy"
            install "qiskit==0.36.2"
            install "matplotlib"

        }
    }

here is the python file I am using

from qiskit import *
from qiskit.tools.visualization import plot_histogram
from qiskit.tools.visualization import plot_state_qsphere
from qiskit.tools.visualization import plot_bloch_multivector

def bv(num):
    return "test return"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天暗了我发光 2025-02-17 10:30:50

看来Qiskit的最后一个纯Python版本为0.7.0,因此您可以尝试一下。较新的版本都包含本机组件,因此需要专门为Android构建。有关更多详细信息,请参见此chaquopy问题

It looks like the last pure-Python version of qiskit was 0.7.0, so you could give that a try. Newer versions all contain native components, so they'd need to be built specifically for Android. For more details, see this Chaquopy issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文