On Fri, Jul 29, 2011 at 5:00 PM, john_perry_usm <[email protected]> wrote: > Hi > > I have a file type1.pyx that defines an extension type Type1, and a > file type2.pyx that defines an extension type Type2. Some attributes > of Type2 are of type Type1. If I have the types in one file, > everything runs fine; I'd like to separate them into different files. > > I placed these files in a local working directory. I can attach > type1.pyx with no problem. I cannot attach type2.pyx; this gives me: > > ImportError: No module named _atlas_perry_..._pyx.type1 > > even though I just attached the file containing extension type Type1, > and I can create objects of type Type1. > > Can someone indicate the correct way to import this type, and/or point > me to the relevant documentation on this? I did do some searching, but > I'm pretty sure that what I found is for extending Sage's > functionality, and not for temporary working files.
You might have better luck with load, as attach re-compiles the file each time and Python can't handle re-loading extension modules very well (hence the re-naming). That failing, if it's growing to the point that you need multiple files, you may have to write (a.k.a. copy and modify) your own setup.py file. - Robert -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
