有没有办法在 python 构建中包含brew注入?
我正在尝试构建一个在浏览器中运行的语音识别应用程序。目前正在与网络工作者一起使用 pyodide。我有自己的包,与 pyaudio 一起构建,用于网络工作人员。
有没有一种方法可以让我在 python 包中包含一个brew注入,特别是portaudio,这样当我构建包时,portaudio就包含在wheel文件中?我需要包含 portaudio 才能在浏览器中工作。
谢谢你!
I'm trying to build a speech recognition application that works in a browser. Currently using pyodide with a web worker. I have my own package, built alongside pyaudio, that I use for the web worker.
Is there a way that I can include a brew instillation, specifically portaudio, inside of my python package so that when I build the package, portaudio is included in the wheel file? I need portaudio included for this to work in the browser.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在这里理解两个不同的问题,所以我会尝试回答这两个问题。
据我所知,答案是否定的。 Python 分发系统与 Homebrew 是分开的,它们不能以这种方式交互。
即使他们可以,这也不一定是可取的:
或许?即使你可以,我几乎肯定不会推荐它。
所有这些原因就是为什么对于大多数具有类似设置的项目,您会发现他们建议在构建 Python 源代码之前先使用系统包管理器安装某些包。
这允许他们选择他们安装的任何包管理器,并且这也应该是一个快速且轻松的过程。
因此,只需将安装说明更改为以下内容:
I'm understanding two different questions here, so I'll try to answer them both.
To my knowledge, the answer is no. The Python distribution system is separate from Homebrew, and they can't interact in this fashion.
Even if they could, this wouldn't necessarily be desirable:
Maybe? Even if you could, I almost certainly wouldn't recommend it.
All these reasons are why for the majority of projects that have a similar setup, you will find that they recommend installing certain packages with their system package manager first, before building the Python source code.
This allows them to choose whatever package manager they have installed, and it should also be a quick and painless process.
Therefore, just change your installation instructions to the following: