Sage 6.9 no longer loads packages from /home/me/.local/lib/python2.7/site-packages

61 views
Skip to first unread message

Mark Bell

unread,
Nov 20, 2015, 3:44:05 PM11/20/15
to sage-support
I've just upgraded to Sage 6.9 from 6.8. I have a large number of packages that I've installed by using:
  python setup.py install --user
so they have been placed in /home/me/.local/lib/python2.7/site-packages/...

Previously Sage would automatically search this location looking for packages and so I could do "import mypackage" and everything would work fine. It now appears that Sage is no longer searching this path automatically and so attempting to import these packages results in a "ImportError: No module named mypackage". Is this a bug or was no longer loading packages from ~/.local/ a deliberate change? It appears that this has been previously listed as a feature of both Sage and Python, see http://sage-devel.narkive.com/kld2G6DI/sage-python-packages-and-local and https://www.python.org/dev/peps/pep-0370/

William Stein

unread,
Nov 21, 2015, 3:05:00 PM11/21/15
to sage-support, sage-devel
This was caused by trac 14243, which -- in retrospect -- I *strongly*
disagree with being included in Sage
(http://trac.sagemath.org/ticket/14243). In SageMathCloud, I manually
revert that ticket so that users have a better experience:

https://github.com/sagemathinc/smc-sage/commit/7c9cfd095463091bcf41e1c6ea6e8eebfb61f00c

I've made http://trac.sagemath.org/ticket/19612 to revert 14243.

- William



> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)

Mark Bell

unread,
Nov 22, 2015, 9:51:30 PM11/22/15
to sage-support, sage-...@googlegroups.com
Thank you for tracking this down so quickly and for already submitting a correction. If I am understanding your response correctly then I think I need to just hope that trac 14243 is accepted and then wait for the next version of sage that includes it. In the mean time, is there any temporary work-around that I can use? I would guess that I can do something like setting the environment variable PYTHONNOUSERSITE=no.

William Stein

unread,
Nov 22, 2015, 10:20:24 PM11/22/15
to sage-s...@googlegroups.com, sage-...@googlegroups.com


On Sunday, November 22, 2015, Mark Bell <mark0...@googlemail.com> wrote:
Thank you for tracking this down so quickly and for already submitting a correction. If I am understanding your response correctly then I think I need to just hope that trac 14243 is accepted and then wait for the next version of sage that includes it. In the mean time, is there any temporary work-around that I can use? I would guess that I can do something like setting the environment variable PYTHONNOUSERSITE=no.





Trac 14243 causes the problem not fixes it.  The only workaround I know of is to hack your copy of sage as mentioned above.   I made http://trac.sagemath.org/ticket/19612 to revert this but nobody seems to agree with it and I'm not going to do the work.  

William

 



--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


--
Sent from my massive iPhone 6 plus.
Reply all
Reply to author
Forward
0 new messages