Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python relative import messes up Sage command line arguments #6385

Closed
rlmill mannequin opened this issue Jun 22, 2009 · 3 comments
Closed

Python relative import messes up Sage command line arguments #6385

rlmill mannequin opened this issue Jun 22, 2009 · 3 comments

Comments

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jun 22, 2009

From:

http://groups.google.com/group/sage-devel/browse_thread/thread/a9e80289571de40e

On Mon, Jun 22, 2009 at 6:38 PM, Robert Millerrlmills...@gmail.com 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

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
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
import notebook as _notebook
File "/Users/rlmill/sage-4.0.2/devel/sage-main/sage/server/notebook/
notebook.py", line 22, in
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

Component: distribution

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/6385

@rlmill rlmill mannequin added this to the sage-5.11 milestone Jun 22, 2009
@rlmill rlmill mannequin added c: distribution labels Jun 22, 2009
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@a-andre
Copy link

a-andre commented Jun 22, 2014

comment:4

Is it still a problem?

@a-andre a-andre removed this from the sage-6.3 milestone Jun 22, 2014
@jdemeyer
Copy link

jdemeyer commented Oct 1, 2014

comment:5

I think it's no longer an issue (although I cannot explain why the problem no longer occurs).

@jdemeyer
Copy link

jdemeyer commented Oct 1, 2014

Reviewer: Jeroen Demeyer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants