Thank you all for the responses. I solved the problem by mimicking the python interpreter and writing a script which appends modules to sys.path. It's included below. (If anyone thinks this is a bad idea, please comment; thanks!)
> Sage ships it own python I would humbly recommend that this issue somehow be made more visible to the user, who may be confused at to why sage isn't respecting the python environment variables or using the defauly python distribution. Perhaps some way to tell sage's python to use installed packages if they're compatible? Best wishes, Mats SITE_PACKAGES_DIR = '/usr/local/lib64/python2.5/site-packages' #replace with your own import sys import os # can also perhaps loop over directories in posix.environ['PYTHONPATH'].split(':') for (root,dirs,files) in os.walk(SITE_PACKAGES_DIR): sys.path += [root] for file in files: #add each .egg compressed directory to the path if file[-4:]=='.egg': sys.path += [os.path.join(root, file)] del dirs On Jun 9, 12:51 pm, mabshoff <[EMAIL PROTECTED]> wrote: > > >> I tried to do "sudo easy_install feedparser", which worked. I can > > >> "import feedparser" from the python shell, but not from sage unless I > > >> explicitly add it to mypath. > > As sys.pathshows by sudoing you are installing into the system wide > python. As William has pointed out that is not the way to do it since > Sage ships it own python that assuming you build it yourself you do > not need to use sudo since you do have write permissions. > > Cheers, > > Michael --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---