简体   繁体   English

使用Sage作为Python库(Windows)

[英]Using Sage as a Python library (Windows)

I'm writing code that is really heavy on linear algebra, specifically matrix operations. 我正在编写在线性代数(特别是矩阵运算)上非常繁琐的代码。 Because the matrices I'm using are very large, I'm running out of memory when I use the SymPy library. 因为我使用的矩阵很大,所以当我使用SymPy库时内存不足。 I think I can do what I want to in with Sage, but for my purposes I can't run my code in a VM. 我想我可以用Sage做我想做的事情,但是出于我的目的,我不能在VM中运行代码。 It has to be on my host OS. 它必须在我的主机操作系统上。 Without going so far as to install Ubuntu or something, is there a way I could add Sage to use as a library in my Python code? 无需安装Ubuntu或其他工具,有什么方法可以添加Sage用作Python代码中的库吗? My Python version is 3.4, OS is Windows 7. Thanks. 我的Python版本是3.4,操作系统是Windows7。谢谢。

Sage can only use its own Python, if that makes sense. 如果可以的话,Sage只能使用自己的Python。 On Windows there are a lot of problems with certain components of Sage compiling properly (non-Python components, of course) which is why there is not a 'native port', though Cygwin should work okay if that is an option for you. 在Windows上,Sage的某些组件正确编译存在很多问题(当然是非Python组件),这就是为什么没有“本地端口”的原因,尽管Cygwin应该可以正常工作。 From what I hear it's not too difficult to set up an Ubuntu partition on a Windows machine, though I have no personal experience with this. 据我了解,在Windows计算机上设置Ubuntu分区并不是太困难,尽管我对此没有任何经验。

(By the way, it's possible that Octave would be a good choice for you, based on your description, or R, which is actually a component of Sage.) (顺便说一句,根据您的描述或R(实际上是Sage的组成部分),八度可能是您的不错选择。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM