Opened 10 years ago

Last modified 10 years ago

#10729 new defect

IPython.CrashHandler import error upon starting sage

Reported by: jorges Owned by:
Priority: major Milestone:
Component: scripts Keywords:
Cc: vbraun Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Local modules located in $HOME/.local/lib/pythonX.Y/site-packages appear in sys.path _before_ IPython/Extensions and thus, a local version of IPython (lacking CrahsHandler? module) replaces sage's own version.

Issue discussed in sage-support, see https://groups.google.com/d/topic/sage-support/mjRgMERg02Y/discussion

Attachments (1)

sage_debug.txt (2.3 KB) - added by jorges 10 years ago.
Example sys.path where local modules come before than sage's own modules

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by jorges

Example sys.path where local modules come before than sage's own modules

comment:1 Changed 10 years ago by vbraun

  • Cc vbraun added

comment:2 Changed 10 years ago by jorges

I just found a workaround to this issue. It doesn't actually solve the bug, but it might be usefull to someone experiencing this:

Citing [1]_: "In addition to the global site-packages paths, site is responsible for adding the user-specific locations to the import path. The user-specific paths are all based on the USER_BASE directory, which usually located in a part of the filesystem owned (and writable) by the current user. Inside the USER_BASE is a site-packages directory, with the path accessible as USER_SITE. The USER_SITE path name is created using the same platform-specific values..." "The user base directory can be set through the PYTHONUSERBASE environment variable, and has platform-specific defaults (~/Python$version/site-packages for Windows and ~/.local for non-Windows)."

Setting PYTHONUSERBASE to a "dummy" location, i.e. an empty directory, prevents python from loading the modules from, say, ~/.local/... which conflict with sage's own.

.. [1] http://www.doughellmann.com/PyMOTW/site/#user-directories

The user base directory can be set through the PYTHONUSERBASE environment variable, and has platform-specific defaults (~/Python$version/site-packages for Windows and ~/.local for non-Windows).

Note: See TracTickets for help on using tickets.