On 04/24/2015 02:02 PM, Jan Groenewald wrote:
> On 24 April 2015 at 14:43, Marc Mezzarobba <[email protected]
> <mailto:[email protected]>> wrote:
> 
>     Jan Groenewald wrote:
>     > I a computer lab environment, with identical desktop images (PPA,
>     > Ubuntu 14.04, 64bit) all except one user can launch the notebook fine.
>     >
>     > For some reason, that user is importing the system-wide twisted and
>     > not the sage twisted.
> 
>     A wild guess: does the user have .pth files anywhere under
>     ~/.local/lib/python*?
> 
> 
> Yes!
> 
> banele@bamako:~/.local/lib/python2.7$ find|grep pth
> ./site-packages/easy-install.pth
> banele@bamako:~/.local/lib/python2.7$ mv site-packages/easy-install.pth
> /tmp/
> banele@bamako:~/.local/lib/python2.7$ sage -q
> sage: import twisted;twisted
> <_ModuleProxy module=<module 'twisted' from
> '/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-x86_64.egg/twisted/__init__.pyc'>>
> sage:
> 
> So, that should be fixed. Would you mind explaining to me what that was?
> 
> I see this:
> banele@bamako:~$ ls .local/lib/python2.7/site-packages/
> nengo.egg-link
> 
> So, I looked and in the users' history, I see this:
> 
>   361  git clone https://github.com/nengo/nengo.git
>   362  cd nengo
>   363  python setup.py develop --user
> 
> And the file in question:
> 
> banele@bamako:~$ ls -l /tmp/easy-install.pth
> -rw------- 1 banele people 253 Mar 30 21:44 /tmp/easy-install.pth
> banele@bamako:~$ cat /tmp/easy-install.pth
> import sys; sys.__plen = len(sys.path)
> /var/autofs/misc/home/banele/nengo
> /usr/lib/python2.7/dist-packages
> import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:];
> p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert =
> p+len(new)
> banele@bamako:~$

The installation of nengo (outside of Sage) certainly added
/usr/lib/python2.7/dist-packages, where apparently also Twisted is found.


> Not sure if they did something wrong, or if sage should be fixed to
> ignore such interference.

Well, there are options to ignore user-specific stuff, but I don't know
what else would break if Sage did use them, i.e., presumably other users
would complain if we did so.  [It would be possible to "fix" sys.path
afterwards w.r.t. "Sage's" or specific modules; not sure though whether
it's worth trying.]


If in doubt, do

$ PYTHONNOUSERSITE=yes sage ...


-leif


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

Reply via email to