Open ec1e6b34-7d5f-489e-a90e-cd5ca2de718c opened 12 years ago
Before you can do any of those specific imports, you need to do
import sage.all
which will import things in the correct order and make sure everything is initialized. After that, you can import what you need.
Replying to @mwhansen:
Before you can do any of those specific imports, you need to do
import sage.all
which will import things in the correct order and make sure everything is initialized. After that, you can import what you need.
I think this nevertheless witnesses some problems with Sage's imports and modularity. Is there a good reason why this shouldn't work ?
Florent
Description changed:
---
+++
@@ -1,7 +1,7 @@
-When I run `sage -python` and then try to import something "specific" (e.g. from the `rings` module), I get the following:
+When I run `sage --python` and then try to import something "specific" (e.g. from the `rings` module), I get the following:
-$ sage -python +$ sage --python Python 2.7.2 (default, May 16 2012, 20:18:27) [GCC 4.6.3] on darwin Type "help", "copyright", "credits" or "license" for more information. @@ -49,18 +49,4 @@ from sage.all import *
-first. Likewise, the import works in ordinary `sage`:
-
-```
-$ sage
-----------------------------------------------------------------------
-| Sage Version 5.0, Release Date: 2012-05-14 |
-| Type notebook() for the GUI, and license() for information. |
-----------------------------------------------------------------------
-sage: from sage.rings.integer_ring import *
-sage:
-```
-
-Issuing `sage -sh` before `sage -python` does not help though.
-
-I'm running Sage 5.0 on Mac OS X 10.5.8.
+first.
When I run
sage --python
and then try to import something "specific" (e.g. from therings
module), I get the following:This also happens for other modules, e.g.
from sage.modules.all import *
. However, it does not occur when I dofirst.
Component: misc
Issue created by migration from https://trac.sagemath.org/ticket/13083