Opened 15 years ago

Closed 8 years ago

#3784 closed enhancement (invalid)

add support for SAGE_PYTHONPATH

Reported by: was Owned by: cwitty
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: misc Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

GitHub link to the corresponding issue

Description

>
> > On Aug 6, 9:33 am, Rupert <rupert.n...@gmail.com> wrote:
> >> Hello there,
>
> > Hi Rupert,
>
> >> I installed sage this morning and am doing some testing. I noticed
> >> that sage was ignoring some python modules that live in a directory on
> >> my PYTHONPATH environment variable.
>
> >> Looking in $SAGE_ROOT/local/bin/sage-env, I see that it completely
> >> overrides my $PYTHONPATH, rather than prepending its own directories.
>
> > Yes, we do that on purpose.

Hi,

> I propose offering a workaround, e.g.,
>         SAGE_PYTHONPATH
> which *does* get appended to PYTHONPATH
> on startup.

That sounds reasonable to me.

> Note that this is for picking up *user* code, so
> it makes a huge amount of sense to support this.
> It's not an issue of system-wide python being
> different than Sage's at all.

Well, people will use it to have Sage pick up the extensions of the
system Python, but then I get to tell you "I told you so" :)

Add something to sage-env that does what is described above. Also add something to the README.txt that documents this behavior.

Attachments (2)

trac_3784.patch (575 bytes) - added by ddrake 14 years ago.
patch for $SAGE_ROOT/local/bin/sage-env
trac_3784_README.patch (772 bytes) - added by ddrake 14 years ago.
patch for README.txt in $SAGE_ROOT

Download all attachments as: .zip

Change History (15)

comment:1 Changed 14 years ago by ddrake

This would be very nice for SageTeX, so that the user could put sagetex.py somewhere and use $SAGE_PYTHONPATH to help Sage automatically find the module.

Changed 14 years ago by ddrake

Attachment: trac_3784.patch added

patch for $SAGE_ROOT/local/bin/sage-env

Changed 14 years ago by ddrake

Attachment: trac_3784_README.patch added

patch for README.txt in $SAGE_ROOT

comment:2 Changed 14 years ago by ddrake

Summary: add support for SAGE_PYTHONPATH[with patch, needs review] add support for SAGE_PYTHONPATH

comment:3 Changed 14 years ago by mabshoff

Summary: [with patch, needs review] add support for SAGE_PYTHONPATH[with patch, needs work] add support for SAGE_PYTHONPATH

I would highly recommend to append PYTHONPATH instead of prepending it. That way if someone has a duplicate python package installed somewhere else, i.e. the system, the Sage packages get preferred treatment. Other people might disagree, so in that case we should take it to sage-devel. So "needs work" for now.

Cheers,

Michael

comment:4 Changed 13 years ago by mhansen

This is already the SAGE_PATH variable that is supposed to be for this purpose.

comment:5 Changed 13 years ago by burcin

Report Upstream: N/A
Summary: [with patch, needs work] add support for SAGE_PYTHONPATHadd support for SAGE_PYTHONPATH

Does the SAGE_PATH variable provide all the functionality requested here? (IMHO, it does.)

In that case, I suggest we close this ticket. There is already a ticket to document the environment variables used by Sage, #8263. I added a comment mentioning SAGE_PATH there.

comment:6 Changed 11 years ago by jhpalmieri

Status: needs_workneeds_info

Should this be closed? As Burcin says, SAGE_PATH solves the problem.

comment:7 Changed 9 years ago by jdemeyer

Milestone: sage-5.11sage-5.12

comment:8 Changed 9 years ago by vbraun_spam

Milestone: sage-6.1sage-6.2

comment:9 Changed 9 years ago by vbraun_spam

Milestone: sage-6.2sage-6.3

comment:10 Changed 9 years ago by vbraun_spam

Milestone: sage-6.3sage-6.4

comment:11 Changed 8 years ago by chapoton

Milestone: sage-6.4sage-duplicate/invalid/wontfix
Status: needs_infoneeds_review

I think this can be closed.

comment:12 Changed 8 years ago by aapitzsch

Status: needs_reviewpositive_review

comment:13 Changed 8 years ago by vbraun

Resolution: invalid
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.