You are not logged in.
Hi,
I am using sagemath often. This ships with its own version of python, which is also bundled with cython. Sometimes I write sage programs, but I also use cythonized python definitions to make things faster. For example, I put my definitions in a file named 'mydefs.pyx', and I create a file ''setup.py' as follows:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
setup(
ext_modules = cythonize("mydefs.pyx")
)Then I will run
sage -python setup.py build_ext --inplacein order to cythonize mydefs.pyx. I use `sage -python` in order to use the python that is built-in to sage (this is essential in order to run those programs in sage later).
This has been working on my school's server and my old computer, where sage is installed. I now got a new computer, installed sage, and tried to do the same. I got:
[jorge@alavanja CAsearch]$ sage -python setup.py build_ext --inplace
Traceback (most recent call last):
File "setup.py", line 3, in <module>
from Cython.Build import cythonize
ImportError: No module named Cython.BuildI googled around and I haven't found a solution. Can somebody point me to the right direction? Why this error message?
Thanks a lot in advance
Last edited by geo909 (2016-03-23 13:50:43)
Offline
How did you install sage?
Offline
How did you install sage?
I installed it from the community repos:
https://www.archlinux.org/packages/?name=sagemath
Offline
arojas wrote:How did you install sage?
I installed it from the community repos:
https://www.archlinux.org/packages/?name=sagemath
Then you're wrong in your assumption that it ships its own version of Python and cython. The sagemath package in community is compiled against system libs. In particular, if you want to use it in cython code you must install the cython2 package. And "sage -python" just calls the system python2.
Offline
geo909 wrote:arojas wrote:How did you install sage?
I installed it from the community repos:
https://www.archlinux.org/packages/?name=sagemathThen you're wrong in your assumption that it ships its own version of Python and cython. The sagemath package in community is compiled against system libs. In particular, if you want to use it in cython code you must install the cython2 package. And "sage -python" just calls the system python2.
Thanks a lot! I was sure, for some reason, that sage came bundled with its own python/cython..
Anyway, I installed cython2 and everything works. Thanks again!
Offline