有没有办法安装 scipy 特殊模块而不需要 scipy 的其余部分?
我正在编写一些 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
scipy 子包通常可以单独安装。 尝试 cd 到“
special
”目录并运行正常的“python setup.py install
”。 用于导入的命名空间现在应该是special
和scipy.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 bespecial
and nowscipy.special
.我对 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.
如果您已经安装了正确版本的 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...