有没有办法安装 scipy 特殊模块而不需要 scipy 的其余部分?

发布于 2024-07-13 05:47:39 字数 279 浏览 3 评论 0原文

我正在编写一些 Python 数字代码,并希望使用 特殊模块 中的一些函数。 到目前为止,我的代码仅依赖于 numpy,我发现它很容易在各种 Python 环境中安装。 另一方面,安装 scipy 通常是一种令人沮丧的练习。 有没有办法只获取特殊模块?

注意,我现在看到有一个适用于 Mac 的可下载 scipy 包,但情况并非总是如此

I'm writing some Python numerical code and would like to use some functions from the special module. So far, my code only depends on numpy, which I've found very easy to install in a variety of Python environments. Installing scipy, on the other hand, has generally been an exercise in frustration. Is there a way to get just the special module?

Note, I see now that there is a downloadable scipy package for the Mac, but that hasn't always been the case

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

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

发布评论

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

评论(3

夏末 2024-07-20 05:47:40

scipy 子包通常可以单独安装。 尝试 cd 到“special”目录并运行正常的“python setup.py install”。 用于导入的命名空间现在应该是 specialscipy.special

The scipy subpackages can usually be installed individually. Try cd-ing to the "special" directory and running your normal "python setup.py install". The name space for importing should now be special and now scipy.special.

场罚期间 2024-07-20 05:47:40

我对 scipy 特别不熟悉,但一般来说,软件包的模块取决于软件包本身的安装。 所以,是的,我很确定您需要安装 scipy 才能使用特殊模块。

I'm not familiar with scipy in particular, but in general, modules for software packages depend on the installation of the package itself. So, yes, I'm pretty sure that you need to install scipy to use the special module.

揽月 2024-07-20 05:47:40

如果您已经安装了正确版本的 Numpy,那么您可以尝试获取特殊模块的源代码,将其粘贴到某个目录中,将其添加到您的 PYTHONPATH 中,然后查看它是否有效。 这一切都取决于它的依赖关系。 如果它具有 Numpy 之外的依赖项,那么您必须安装它们,如果它们具有依赖项......

If you already have the right version of Numpy installed then you could try to just take the source for the special module, stick it in a directory somewhere, add it to your PYTHONPATH, and see if it works. It all depends on its dependencies. If it has dependencies beyond Numpy, then you'll have to install those, and if those have dependencies...

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