#6385: Python relative import messes up Sage command line arguments
--------------------------+-------------------------------------------------
Reporter: rlm | Owner: tbd
Type: defect | Status: new
Priority: major | Milestone: sage-4.1
Component: distribution | Keywords:
Reviewer: | Author:
Merged: |
--------------------------+-------------------------------------------------
From:
http://groups.google.com/group/sage-
devel/browse_thread/thread/a9e80289571de40e
On Mon, Jun 22, 2009 at 6:38 PM, Robert Miller<[email protected]>
wrote:
> I tried running the Sage notebook as follows, from SAGE_ROOT/devel/
> sage-main:
> $ ../../sage -notebook
> And I get the following error:
> Please wait while the Sage Notebook server starts...
> Traceback (most recent call last):
> File "/Users/rlmill/sage-4.0.2/local/bin/sage-notebook", line 9, in
> <module>
> from sage.server.notebook.all import notebook
> File "/Users/rlmill/sage-4.0.2/devel/sage-main/sage/server/notebook/
> all.py", line 15, in <module>
> from notebook_object import notebook, inotebook
> File "/Users/rlmill/sage-4.0.2/devel/sage-main/sage/server/notebook/
> notebook_object.py", line 19, in <module>
> import notebook as _notebook
> File "/Users/rlmill/sage-4.0.2/devel/sage-main/sage/server/notebook/
> notebook.py", line 22, in <module>
> from sage.structure.sage_object import SageObject, load
> ImportError: No module named sage_object
> Can anyone reproduce this?
In python imports are relative by default, so "import sage" does not
mean what you think. I think long ago I hacked around this problem
for just typing "sage" to start sage, by making it change to a
different directory during startup. (I vaguely recall doing that
specifically to get Sage to work on Cygwin, actually.)
So I think the above should be considered a bug, and you should
definitely report it to trac. Probably the fix is to change the
directory during part of Sage startup, to thwart Python's relative
import system.
William
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6385>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en
-~----------~----~----~----~------~----~------~--~---