Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

missing key "SAGE_LOCAL" while "import sage.all"

Hello I tried to do some debugging in PyDev.

Variable sage.env.SAGE_LOCAL is "/usr/lib/sagemath//local", so maybe OK, maybe not. I don't know where this double slash comes from.When I write $SAGE_LOCAL in bash, I get "/usr/lib/sagemath/local"

However SAGE looks for this variable in some dictionary that looks like this (my system variables):

{'PYTHONIOENCODING': 'UTF-8', 'LIBOVERLAY_SCROLLBAR': '0', 'XDG_RUNTIME_DIR': '/run/user/1000', 'XDG_CURRENT_DESKTOP': 'KDE', 'XDG_SESSION_TYPE': 'x11', 'QT_IM_MODULE': 'compose', 'LOGNAME': 'a', 'USER': 'a', 'HOME': '/home/a', 'XDG_VTNR': '7', 'PATH': '/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/lib64/MRO-3.2.3/R-3.2.3/lib/R:/home/a/anaconda2/bin', 'PYTHONUNBUFFERED': '1', 'PAM_KWALLET_LOGIN': '/tmp/kwallet_a.socket', 'KDE_SESSION_VERSION': '5', 'KDE_FULL_SESSION': 'true', 'XDG_SESSION_DESKTOP': 'KDE', 'TERM': 'emacs', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session1', 'XAUTHORITY': '/tmp/xauth-1000-_0', 'SESSION_MANAGER': 'local/a-GA-970A-DS3:@/tmp/.ICE-unix/3105,unix/a-GA-970A-DS3:/tmp/.ICE-unix/3105', 'XDG_DATA_DIRS': '/usr/share//usr/share/xsessions/plasma:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'QT_LINUX_ACCESSIBILITY_ALWAYS_ON': '1', 'MANDATORY_PATH': '/usr/share/gconf//usr/share/xsessions/plasma.mandatory.path', 'GDK_SCALE': '1', 'XCURSOR_THEME': 'breeze_cursors', 'PYDEV_CONSOLE_ENCODING': 'UTF-8', 'DISPLAY': ':0', 'SSH_AGENT_PID': '3007', 'XDG_SESSION_CLASS': 'user', 'LANG': 'en_US.UTF-8', 'SSH_AUTH_SOCK': '/tmp/ssh-0i02vLbBNNxF/agent.2936', 'GTK_RC_FILES': '/etc/gtk/gtkrc:/home/a/.gtkrc:/home/a/.config/gtkrc', 'PYTHONPATH': '/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/liclipse3/liclipse/plugins/org.python.pydev_5.2.0.201608171655/pysrc/pydev_sitecustomize:/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/work/czesc:/usr/lib/sagemath/local/lib/python2.7/site-packages/setuptools-23.1.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pkgconfig-1.1.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/six-1.10.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Pygments-2.1.3-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/speaklater-1.3-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/future-0.15.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_OldSessions-0.10-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/zope.interface-4.2.0-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/backports_abc-0.4-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/certifi-2016.2.28-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/singledispatch-3.4.0.3-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/setuptools_scm-1.11.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pathlib2-2.1.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/simplegeneric-0.8.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/decorator-4.0.6-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/backports.shutil_get_terminal_size-1.0.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/networkx-1.11-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/python_dateutil-2.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pyparsing-2.1.5-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/cycler-0.10.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/vcversioner-2.16.0.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/sympy-1.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Cython-0.24.1-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/MarkupSafe-0.23-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/imagesize-0.7.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/alabaster-0.7.8-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pytz-2016.4-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/itsdangerous-0.24-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/tornado-4.3-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/path.py-7.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-16.2.0-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/jsonschema-2.5.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/mistune-0.7.3-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/widgetsnbextension-1.2.3-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Babel-2.3.4-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pickleshare-0.7.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Sphinx-1.4.4-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_Babel-0.9-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/sagenb_export-2.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_OpenID-1.2.5-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_Silk-0.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_AutoIndex-0.6-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/matplotlib-1.5.1-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/rpy2-2.8.1-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7:/usr/lib/sagemath/local/lib/python2.7/plat-linux2:/usr/lib/sagemath/local/lib/python2.7/lib-tk:/usr/lib/sagemath/local/lib/python2.7/lib-dynload:/home/a/.local/lib/python2.7/site-packages:/usr/lib/sagemath/local/lib/python2.7/site-packages', 'KDE_SESSION_UID': '1000', 'RSTUDIO_WHICH_R': '/usr/bin/R', 'PAM_KWALLET5_LOGIN': '/tmp/kwallet5_a.socket', 'GTK2_RC_FILES': '/etc/gtk-2.0/gtkrc:/home/a/.gtkrc-2.0:/home/a/.config/gtkrc-2.0', 'QT_ACCESSIBILITY': '1', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'NLSPATH': '/usr/dt/lib/nls/msg/%L/%N.cat', 'XDG_SESSION_ID': '2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-pzHVRXCPV8,guid=4972551291c9e25826bcbe5257e3f8bf', 'SAGE_ROOT': '/usr/lib/sagemath/', 'XDG_SESSION_COOKIE': '13d64d8e905acf8de2069a915679dd81-1474558143.775287-409625629', 'DESKTOP_SESSION': '/usr/share/xsessions/plasma', 'GPG_AGENT_INFO': '/home/a/.gnupg/S.gpg-agent:0:1', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-/usr/share/xsessions/plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings', 'DEFAULTS_PATH': '/usr/share/gconf//usr/share/xsessions/plasma.default.path', 'OXYGEN_DISABLE_INNER_SHADOWS_HACK': '1', 'XDG_SEAT': 'seat0', 'PYDEV_COMPLETER_PYTHONPATH': '/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/liclipse3/liclipse/plugins/org.python.pydev_5.2.0.201608171655/pysrc', 'GS_LIB': '/home/a/.fonts', 'SHLVL': '0', 'PWD': '/home/a', 'SWT_GTK3': '0', 'XFILESEARCHPATH': '/usr/dt/app-defaults/%L/Dt', 'KDE_MULTIHEAD': 'false'}

Where can I change this dictionary?

Full traceback looks like this (don't think it's useful):

Traceback (most recent call last): File "/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/work/trial/py.py", line 7, in <module> import sage.all File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/all.py", line 103, in <module> from sage.rings.all import * File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/all.py", line 54, in <module> from .number_field.all import * File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/number_field/all.py", line 9, in <module> from .totallyreal import enumerate_totallyreal_fields_prim File "sage/rings/number_field/totallyreal_data.pxd", line 12, in init sage.rings.number_field.totallyreal (/usr/lib/sagemath//src/build/cythonized/sage/rings/number_field/totallyreal.c:11599) File "sage/rings/number_field/totallyreal_data.pyx", line 39, in init sage.rings.number_field.totallyreal_data (/usr/lib/sagemath//src/build/cythonized/sage/rings/number_field/totallyreal_data.c:12293) File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 461, in PolynomialRing R = _single_variate(base_ring, name, sparse, implementation) File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 539, in _single_variate R = m.PolynomialRing_integral_domain(base_ring, name, sparse, implementation) File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 1533, in __init__ sparse=sparse, element_class=element_class, category=category) File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 1440, in __init__ sparse=sparse, element_class=element_class, category=category) File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 289, in __init__ from sage.matrix.matrix_space import is_MatrixSpace File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/matrix/matrix_space.py", line 58, in <module> from . import matrix_mpolynomial_dense File "sage/rings/polynomial/multi_polynomial_libsingular.pxd", line 6, in init sage.matrix.matrix_mpolynomial_dense (/usr/lib/sagemath//src/build/cythonized/sage/matrix/matrix_mpolynomial_dense.cpp:8645) File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 1, in init sage.rings.polynomial.multi_polynomial_libsingular (/usr/lib/sagemath//src/build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:47820) File "sage/libs/singular/singular.pyx", line 750, in init sage.libs.singular.singular (/usr/lib/sagemath//src/build/cythonized/sage/libs/singular/singular.cpp:9743) File "sage/libs/singular/singular.pyx", line 715, in sage.libs.singular.singular.init_libsingular (/usr/lib/sagemath//src/build/cythonized/sage/libs/singular/singular.cpp:7790) File "/usr/lib/sagemath/local/lib/python2.7/UserDict.py", line 23, in __getitem__ raise KeyError(key) KeyError: 'SAGE_LOCAL'

missing key "SAGE_LOCAL" while "import sage.all"

Hello I tried to do some debugging in PyDev.PyDev. I haven't done any math there yet, just tried to import sage.all and failed.

Variable sage.env.SAGE_LOCAL is "/usr/lib/sagemath//local", so maybe OK, maybe not. I don't know where this double slash comes from.When I write $SAGE_LOCAL in bash, I get "/usr/lib/sagemath/local"

This is my sage.env.SAGE_ENV:

 {'SAGE_LOCAL': '/usr/lib/sagemath//local', 'SAGE_IMPORTALL': 'yes', 'SITE_PACKAGES': ['/usr/lib/sagemath/local/lib/python2.7/site-packages', '/usr/lib/sagemath/local/lib/site-python'], 'SAGE_BANNER': '', 'TRAC_SERVER_URI': 'https://trac.sagemath.org', 'SAGE_EXTCODE': '/usr/lib/sagemath//local/share/sage/ext', 'SAGE_CYTHONIZED': '/usr/lib/sagemath//src/build/cythonized', 'SAGE_DOC_SRC': '/usr/lib/sagemath//src/doc', 'SAGE_ETC': '/usr/lib/sagemath//local/etc', 'SAGE_REPO_AUTHENTICATED': 'ssh://git@trac.sagemath.org:2222/sage.git', 'SAGE_STARTUP_FILE': '/home/a/.sage/init.sage', 'SAGE_DOT_GIT': '/usr/lib/sagemath//.git', 'UNAME': 'Linux', 'SAGE_SHARE': '/usr/lib/sagemath//local/share', 'PYTHON_EGG_CACHE': '/home/a/.sage/.python-eggs', 'SAGE_SPKG_INST': '/usr/lib/sagemath//local/var/lib/sage/installed', 'SAGE_REPO_ANONYMOUS': 'git://trac.sagemath.org/sage.git', 'SAGE_DOC': '/usr/lib/sagemath//local/share/doc/sage', 'SAGE_VERSION': '7.3', 'REALM': 'sage.math.washington.edu', 'SAGE_INC': '/usr/lib/sagemath//local/include', 'SAGE_DATE': '2016-08-04', 'SAGE_SRC': '/usr/lib/sagemath//src', 'SAGE_LIB': '/usr/lib/sagemath/local/lib/python2.7/site-packages', 'SAGE_DISTFILES': '/usr/lib/sagemath//upstream', 'LOCAL_IDENTIFIER': 'a-GA-970A-DS3.7845', 'SAGE_ROOT': '/usr/lib/sagemath/', 'HOSTNAME': 'a-GA-970A-DS3', 'SAGE_URL': 'http://sage.math.washington.edu/sage/', 'DOT_SAGE': '/home/a/.sage', 'SAGE_LOGS': '/usr/lib/sagemath//logs/pkgs'}

However SAGE looks for this variable in some dictionary that looks like this (my system variables):

{'PYTHONIOENCODING': 'UTF-8', 'LIBOVERLAY_SCROLLBAR': '0', 'XDG_RUNTIME_DIR': '/run/user/1000', 'XDG_CURRENT_DESKTOP': 'KDE', 'XDG_SESSION_TYPE': 'x11', 'QT_IM_MODULE': 'compose', 'LOGNAME': 'a', 'USER': 'a', 'HOME': '/home/a', 'XDG_VTNR': '7', 'PATH': '/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/lib64/MRO-3.2.3/R-3.2.3/lib/R:/home/a/anaconda2/bin', 'PYTHONUNBUFFERED': '1', 'PAM_KWALLET_LOGIN': '/tmp/kwallet_a.socket', 'KDE_SESSION_VERSION': '5', 'KDE_FULL_SESSION': 'true', 'XDG_SESSION_DESKTOP': 'KDE', 'TERM': 'emacs', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session1', 'XAUTHORITY': '/tmp/xauth-1000-_0', 'SESSION_MANAGER': 'local/a-GA-970A-DS3:@/tmp/.ICE-unix/3105,unix/a-GA-970A-DS3:/tmp/.ICE-unix/3105', 'XDG_DATA_DIRS': '/usr/share//usr/share/xsessions/plasma:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'QT_LINUX_ACCESSIBILITY_ALWAYS_ON': '1', 'MANDATORY_PATH': '/usr/share/gconf//usr/share/xsessions/plasma.mandatory.path', 'GDK_SCALE': '1', 'XCURSOR_THEME': 'breeze_cursors', 'PYDEV_CONSOLE_ENCODING': 'UTF-8', 'DISPLAY': ':0', 'SSH_AGENT_PID': '3007', 'XDG_SESSION_CLASS': 'user', 'LANG': 'en_US.UTF-8', 'SSH_AUTH_SOCK': '/tmp/ssh-0i02vLbBNNxF/agent.2936', 'GTK_RC_FILES': '/etc/gtk/gtkrc:/home/a/.gtkrc:/home/a/.config/gtkrc', 'PYTHONPATH': '/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/liclipse3/liclipse/plugins/org.python.pydev_5.2.0.201608171655/pysrc/pydev_sitecustomize:/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/work/czesc:/usr/lib/sagemath/local/lib/python2.7/site-packages/setuptools-23.1.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pkgconfig-1.1.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/six-1.10.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Pygments-2.1.3-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/speaklater-1.3-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/future-0.15.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_OldSessions-0.10-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/zope.interface-4.2.0-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/backports_abc-0.4-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/certifi-2016.2.28-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/singledispatch-3.4.0.3-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/setuptools_scm-1.11.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pathlib2-2.1.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/simplegeneric-0.8.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/decorator-4.0.6-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/backports.shutil_get_terminal_size-1.0.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/networkx-1.11-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/python_dateutil-2.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pyparsing-2.1.5-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/cycler-0.10.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/vcversioner-2.16.0.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/sympy-1.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Cython-0.24.1-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/MarkupSafe-0.23-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/imagesize-0.7.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/alabaster-0.7.8-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pytz-2016.4-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/itsdangerous-0.24-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Werkzeug-0.11.10-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/tornado-4.3-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/path.py-7.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Twisted-16.2.0-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/jsonschema-2.5.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/mistune-0.7.3-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/widgetsnbextension-1.2.3-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Babel-2.3.4-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/pickleshare-0.7.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Sphinx-1.4.4-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_Babel-0.9-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/sagenb_export-2.0-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_OpenID-1.2.5-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_Silk-0.2-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/Flask_AutoIndex-0.6-py2.7.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/matplotlib-1.5.1-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7/site-packages/rpy2-2.8.1-py2.7-linux-x86_64.egg:/usr/lib/sagemath/local/lib/python2.7:/usr/lib/sagemath/local/lib/python2.7/plat-linux2:/usr/lib/sagemath/local/lib/python2.7/lib-tk:/usr/lib/sagemath/local/lib/python2.7/lib-dynload:/home/a/.local/lib/python2.7/site-packages:/usr/lib/sagemath/local/lib/python2.7/site-packages', 'KDE_SESSION_UID': '1000', 'RSTUDIO_WHICH_R': '/usr/bin/R', 'PAM_KWALLET5_LOGIN': '/tmp/kwallet5_a.socket', 'GTK2_RC_FILES': '/etc/gtk-2.0/gtkrc:/home/a/.gtkrc-2.0:/home/a/.config/gtkrc-2.0', 'QT_ACCESSIBILITY': '1', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'NLSPATH': '/usr/dt/lib/nls/msg/%L/%N.cat', 'XDG_SESSION_ID': '2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-pzHVRXCPV8,guid=4972551291c9e25826bcbe5257e3f8bf', 'SAGE_ROOT': '/usr/lib/sagemath/', 'XDG_SESSION_COOKIE': '13d64d8e905acf8de2069a915679dd81-1474558143.775287-409625629', 'DESKTOP_SESSION': '/usr/share/xsessions/plasma', 'GPG_AGENT_INFO': '/home/a/.gnupg/S.gpg-agent:0:1', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-/usr/share/xsessions/plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings', 'DEFAULTS_PATH': '/usr/share/gconf//usr/share/xsessions/plasma.default.path', 'OXYGEN_DISABLE_INNER_SHADOWS_HACK': '1', 'XDG_SEAT': 'seat0', 'PYDEV_COMPLETER_PYTHONPATH': '/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/liclipse3/liclipse/plugins/org.python.pydev_5.2.0.201608171655/pysrc', 'GS_LIB': '/home/a/.fonts', 'SHLVL': '0', 'PWD': '/home/a', 'SWT_GTK3': '0', 'XFILESEARCHPATH': '/usr/dt/app-defaults/%L/Dt', 'KDE_MULTIHEAD': 'false'}

'KDE''...}

Last instruction is

from . import matrix_mpolynomial_dense   in  matrix_space.py

Before:

 else:
            from sage.matrix.matrix_space import is_MatrixSpace   ( in definition of class class PolynomialRing_general(sage.algebras.algebra.Algebra):

Where can I change this dictionary?

Full traceback looks like this (don't think it's useful):

Traceback (most recent call last):
  File "/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/work/trial/py.py", line 7, in <module>
    import sage.all
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/all.py", line 103, in <module>
    from sage.rings.all      import *
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/all.py", line 54, in <module>
    from .number_field.all import *
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/number_field/all.py", line 9, in <module>
    from .totallyreal import enumerate_totallyreal_fields_prim
  File "sage/rings/number_field/totallyreal_data.pxd", line 12, in init sage.rings.number_field.totallyreal (/usr/lib/sagemath//src/build/cythonized/sage/rings/number_field/totallyreal.c:11599)
  File "sage/rings/number_field/totallyreal_data.pyx", line 39, in init sage.rings.number_field.totallyreal_data (/usr/lib/sagemath//src/build/cythonized/sage/rings/number_field/totallyreal_data.c:12293)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 461, in PolynomialRing
    R = _single_variate(base_ring, name, sparse, implementation)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 539, in _single_variate
    R = m.PolynomialRing_integral_domain(base_ring, name, sparse, implementation)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 1533, in __init__
    sparse=sparse, element_class=element_class, category=category)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 1440, in __init__
    sparse=sparse, element_class=element_class, category=category)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 289, in __init__
    from sage.matrix.matrix_space import is_MatrixSpace
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/matrix/matrix_space.py", line 58, in <module>
    from . import matrix_mpolynomial_dense
  File "sage/rings/polynomial/multi_polynomial_libsingular.pxd", line 6, in init sage.matrix.matrix_mpolynomial_dense (/usr/lib/sagemath//src/build/cythonized/sage/matrix/matrix_mpolynomial_dense.cpp:8645)
  File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 1, in init sage.rings.polynomial.multi_polynomial_libsingular (/usr/lib/sagemath//src/build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:47820)
  File "sage/libs/singular/singular.pyx", line 750, in init sage.libs.singular.singular (/usr/lib/sagemath//src/build/cythonized/sage/libs/singular/singular.cpp:9743)
  File "sage/libs/singular/singular.pyx", line 715, in sage.libs.singular.singular.init_libsingular (/usr/lib/sagemath//src/build/cythonized/sage/libs/singular/singular.cpp:7790)
  File "/usr/lib/sagemath/local/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'SAGE_LOCAL'

'SAGE_LOCAL'

missing key "SAGE_LOCAL" while "import sage.all"

Hello I tried to do some debugging in PyDev. I haven't done any math there yet, just tried to import sage.all and failed.

Variable sage.env.SAGE_LOCAL is "/usr/lib/sagemath//local", so maybe OK, maybe not. I don't know where this double slash comes from.When I write $SAGE_LOCAL in bash, I get "/usr/lib/sagemath/local"

This is my sage.env.SAGE_ENV:

 {'SAGE_LOCAL': '/usr/lib/sagemath//local', 'SAGE_IMPORTALL': 'yes', 'SITE_PACKAGES': ['/usr/lib/sagemath/local/lib/python2.7/site-packages', '/usr/lib/sagemath/local/lib/site-python'], 'SAGE_BANNER': '', 'TRAC_SERVER_URI': 'https://trac.sagemath.org', 'SAGE_EXTCODE': '/usr/lib/sagemath//local/share/sage/ext', 'SAGE_CYTHONIZED': '/usr/lib/sagemath//src/build/cythonized', 'SAGE_DOC_SRC': '/usr/lib/sagemath//src/doc', 'SAGE_ETC': '/usr/lib/sagemath//local/etc', 'SAGE_REPO_AUTHENTICATED': 'ssh://git@trac.sagemath.org:2222/sage.git', 'SAGE_STARTUP_FILE': '/home/a/.sage/init.sage', 'SAGE_DOT_GIT': '/usr/lib/sagemath//.git', 'UNAME': 'Linux', 'SAGE_SHARE': '/usr/lib/sagemath//local/share', 'PYTHON_EGG_CACHE': '/home/a/.sage/.python-eggs', 'SAGE_SPKG_INST': '/usr/lib/sagemath//local/var/lib/sage/installed', 'SAGE_REPO_ANONYMOUS': 'git://trac.sagemath.org/sage.git', 'SAGE_DOC': '/usr/lib/sagemath//local/share/doc/sage', 'SAGE_VERSION': '7.3', 'REALM': 'sage.math.washington.edu', 'SAGE_INC': '/usr/lib/sagemath//local/include', 'SAGE_DATE': '2016-08-04', 'SAGE_SRC': '/usr/lib/sagemath//src', 'SAGE_LIB': '/usr/lib/sagemath/local/lib/python2.7/site-packages', 'SAGE_DISTFILES': '/usr/lib/sagemath//upstream', 'LOCAL_IDENTIFIER': 'a-GA-970A-DS3.7845', 'SAGE_ROOT': '/usr/lib/sagemath/', 'HOSTNAME': 'a-GA-970A-DS3', 'SAGE_URL': 'http://sage.math.washington.edu/sage/', 'DOT_SAGE': '/home/a/.sage', 'SAGE_LOGS': '/usr/lib/sagemath//logs/pkgs'}

However SAGE looks for this variable in some dictionary that looks like this (my system variables):

{'PYTHONIOENCODING': 'UTF-8', 'LIBOVERLAY_SCROLLBAR': '0', 'XDG_RUNTIME_DIR': '/run/user/1000', 'XDG_CURRENT_DESKTOP': 'KDE', 'XDG_SESSION_TYPE': 'x11', 'QT_IM_MODULE': 'compose', 'LOGNAME': 'a', 'USER': 'a', 'HOME': '/home/a', 'XDG_VTNR': '7', 'PATH': '/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/lib64/MRO-3.2.3/R-3.2.3/lib/R:/home/a/anaconda2/bin', 'PYTHONUNBUFFERED': '1', 'PAM_KWALLET_LOGIN': '/tmp/kwallet_a.socket', 'KDE_SESSION_VERSION': '5', 'KDE_FULL_SESSION': 'true', 'XDG_SESSION_DESKTOP': 'KDE''...}

Last instruction is

from . import matrix_mpolynomial_dense   in  matrix_space.py

Before:

 else:
            from sage.matrix.matrix_space import is_MatrixSpace   is_MatrixSpace

( in definition of class class PolynomialRing_general(sage.algebras.algebra.Algebra): PolynomialRing_general(sage.algebras.algebra.Algebra in polynomial_ring.py)

And it all started with

   from sage.rings.all      import *

Where can I change this dictionary?in all.py

Full traceback looks like this (don't think it's useful):

Traceback (most recent call last):
  File "/mnt/dca8bb8a-0bad-49dc-bd48-7f32e4fb2114/Downloads/work/trial/py.py", line 7, in <module>
    import sage.all
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/all.py", line 103, in <module>
    from sage.rings.all      import *
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/all.py", line 54, in <module>
    from .number_field.all import *
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/number_field/all.py", line 9, in <module>
    from .totallyreal import enumerate_totallyreal_fields_prim
  File "sage/rings/number_field/totallyreal_data.pxd", line 12, in init sage.rings.number_field.totallyreal (/usr/lib/sagemath//src/build/cythonized/sage/rings/number_field/totallyreal.c:11599)
  File "sage/rings/number_field/totallyreal_data.pyx", line 39, in init sage.rings.number_field.totallyreal_data (/usr/lib/sagemath//src/build/cythonized/sage/rings/number_field/totallyreal_data.c:12293)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 461, in PolynomialRing
    R = _single_variate(base_ring, name, sparse, implementation)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 539, in _single_variate
    R = m.PolynomialRing_integral_domain(base_ring, name, sparse, implementation)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 1533, in __init__
    sparse=sparse, element_class=element_class, category=category)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 1440, in __init__
    sparse=sparse, element_class=element_class, category=category)
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 289, in __init__
    from sage.matrix.matrix_space import is_MatrixSpace
  File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/matrix/matrix_space.py", line 58, in <module>
    from . import matrix_mpolynomial_dense
  File "sage/rings/polynomial/multi_polynomial_libsingular.pxd", line 6, in init sage.matrix.matrix_mpolynomial_dense (/usr/lib/sagemath//src/build/cythonized/sage/matrix/matrix_mpolynomial_dense.cpp:8645)
  File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 1, in init sage.rings.polynomial.multi_polynomial_libsingular (/usr/lib/sagemath//src/build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:47820)
  File "sage/libs/singular/singular.pyx", line 750, in init sage.libs.singular.singular (/usr/lib/sagemath//src/build/cythonized/sage/libs/singular/singular.cpp:9743)
  File "sage/libs/singular/singular.pyx", line 715, in sage.libs.singular.singular.init_libsingular (/usr/lib/sagemath//src/build/cythonized/sage/libs/singular/singular.cpp:7790)
  File "/usr/lib/sagemath/local/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'SAGE_LOCAL'