Sage uses system-wide python...
I've just compiled the latest sage, it tries to import my system-wide ipython instead of its own - and won't run:
./sage
----------------------------------------------------------------------
| Sage Version 5.0, Release Date: 2012-05-14 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/boris/its/soft/sft/sage-5.0-x86_64/local/bin/sage-ipython", line 18, in <module>
import IPython
File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 46, in <module>
from .frontend.terminal.embed import embed
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/embed.py", line 37, in <module>
from IPython.frontend.terminal.ipapp import load_default_config
File "/usr/lib/python2.7/dist-packages/IPython/frontend/terminal/ipapp.py", line 38, in <module>
from IPython.core.completer import IPCompleter
File "/usr/lib/python2.7/dist-packages/IPython/core/completer.py", line 84, in <module>
from IPython.utils import generics
File "/usr/lib/python2.7/dist-packages/IPython/utils/generics.py", line 19, in <module>
from IPython.external.simplegeneric import generic
File "/usr/lib/python2.7/dist-packages/IPython/external/simplegeneric/__init__.py", line 4, in <module>
from _simplegeneric import *
ImportError: No module named _simplegeneric
Edit:
I purged my ~/.config/ipython
as well as ~/.sage
. No help. I tried to load sage's ipython manually:
import imp
IPython = imp.imp.load_source('IPython', os.environ['SAGE_ROOT']+'/local/lib/python2.7/site-packages/IPython/__init__.py')
Now it gives another error:
/home/boris/its/soft/sft/sage-5.0-x86_64
Traceback (most recent call last):
File "/home/boris/its/soft/sft/sage-5.0-x86_64/local/bin/sage-ipython", line 21, in <module>
IPython = imp.load_source('IPython', os.environ['SAGE_ROOT']+'/local/lib/python2.7/site-packages/IPython/__init__.py')
File "/home/boris/its/soft/sft/sage-5.0-x86_64/local/lib/python2.7/site-packages/IPython/__init__.py", line 58, in <module>
__import__(name,glob,loc,[])
ImportError: No module named ipapi
Edit 2:
./sage -sh
echo $PYTHONPATH
gives me
/home/boris/its/soft/sft/sage-5.0-x86_64/local/lib/python
What does Your sage gives You in that case?
Edit 3:
Here's a list of all of my environment variables (obtained with set -o posix ; set
):
BASH=/bin/bash
BASHOPTS=checkwinsize:cmdhist:expand_aliases:extglob:extquote:force_fignore:histappend:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_COMPLETION=/etc/bash_completion
BASH_COMPLETION_COMPAT_DIR=/etc/bash_completion.d
BASH_COMPLETION_DIR=/etc/bash_completion.d
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="2" [2]="24" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
BASH_VERSION='4.2.24(1)-release'
COLORFGBG='0;15'
COLUMNS=137
COMP_WORDBREAKS='
"'\''><=;|&(:'
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-fP3EcB8b5v,guid=e608bfdcea2634dcce5aa08c00000039
DEFAULTS_PATH=/usr/share/gconf/kde-plasma.default.path
DESKTOP_SESSION=kde-plasma
DIRSTACK=()
DISPLAY=:0
DM_CONTROL=/var/run/xdmctl
EUID=1000
GPG_AGENT_INFO=/tmp/gpg-PpUHRE/S.gpg-agent:1495:1
GROUPS=()
GS_LIB=/home/boris/.fonts
GTK2_RC_FILES=/home/boris/.gtkrc-2.0-kde4
GTK_MODULES=canberra-gtk-module:canberra-gtk-module
HISTCONTROL=ignoredups:ignorespace
HISTFILE=/home/boris/.bash_history
HISTFILESIZE=2000
HISTSIZE=1000
HISTTIMEFORMAT='%T '
HOME=/home/boris
HOSTNAME=vasilisa
HOSTTYPE=x86_64
IFS='
'
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=4
KONSOLE_DBUS_SERVICE=:1.115
KONSOLE_DBUS_SESSION=/Sessions/1
LANG=en_US.UTF-8
LANGUAGE=
LESSCLOSE='/usr/bin/lesspipe %s %s'
LESSOPEN='| /usr/bin/lesspipe %s'
LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr ...
Do you have some environment variables set up that point Python in the wrong place? For example,
PYTHONPATH
?I'm using custom PYTHONPATH, but now I turned it off: `echo $PYTHONPATH` gives nothing. But still the error comes up.