[sage-support] Re: 'Sage Crash Report

2017-10-06 Thread Dima Pasechnik
Are you on Fedora 26? Then it looks like this:

It looks like you hit this bug: 
https://bugzilla.redhat.com/show_bug.cgi?id=1464520 

You need to install psutils: 
$ dnf install python2-psutil 

On Friday, October 6, 2017 at 4:34:09 PM UTC+1, Lee Duke wrote:
>
> *** 
>
>
> IPython post-mortem report 
>
> {'commit_hash': u'5c9c918', 
>   'commit_source': 'installation', 
>   'default_encoding': 'UTF-8', 
>   'ipython_path': '/usr/lib64/sagemath/site-packages/IPython', 
>   'ipython_version': '5.1.0', 
>   'os_name': 'posix', 
>   'platform': 
> 'Linux-4.12.9-300.fc26.x86_64-x86_64-with-fedora-26-Twenty_Six', 
>   'sys_executable': '/usr/lib64/sagemath/local/bin/python', 
>   'sys_platform': 'linux2', 
>   'sys_version': '2.7.13 (default, Sep  5 2017, 08:53:59) \n[GCC 7.1.1 
> 20170622 (Red Hat 7.1.1-3)]'} 
>
> *** 
>
>
>
>
> *** 
>
>
> Crash traceback: 
>
> --- 
>
> --- 
>
> ImportError Python 2.7.13: 
> /usr/lib64/sagemath/local/bin/python 
> Fri Oct  6 11:28:35 
> 2017 
> A problem occurred executing Python code.  Here is the sequence of 
> function 
> calls leading up to the error, with the most recent (innermost) call last. 
> /usr/lib64/sagemath/local/bin/sage-ipython in () 
>1 #!/usr/bin/env python 
>2 # -*- coding: utf-8 -*- 
>3 """ 
>4 Sage IPython startup script. 
>5 """ 
>6 
>7 from sage.repl.interpreter import SageTerminalApp 
>8 
>9 app = SageTerminalApp.instance() 
> ---> 10 app.initialize() 
>  global app.initialize =  SageTerminalApp.initialize of  object at 0x7f9a675e1290>> 
>   11 app.start() 
>
>  in 
> initialize(self=, argv=None) 
>
> /usr/lib/python2.7/site-packages/traitlets/config/application.pyc in 
> catch_config_error(method=, 
> app=, *args=(None,), 
> **kwargs={}) 
>   72 TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR = False 
>   73 else: 
>   74 raise ValueError("Unsupported value for environment 
> variable: 'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to '%s' 
> which is none of  {'0', '1', 'false', 'true', ''}."% _envvar ) 
>   75 
>   76 
>   77 @decorator 
>   78 def catch_config_error(method, app, *args, **kwargs): 
>   79 """Method decorator for catching invalid config 
> (Trait/ArgumentErrors) during init. 
>   80 
>   81 On a TraitError (generally caused by bad config), this will 
> print the trait's 
>   82 message, and exit the app. 
>   83 
>   84 For use on init methods, to prevent invoking excepthook on 
> invalid input. 
>   85 """ 
>   86 try: 
> ---> 87 return method(app, *args, **kwargs) 
>  method =  
>  app =  0x7f9a675e1290> 
>  args = (None,) 
>  kwargs = {} 
>   88 except (TraitError, ArgumentError) as e: 
>   89 app.print_help() 
>   90 app.log.fatal("Bad config encountered during 
> initialization:") 
>   91 app.log.fatal(str(e)) 
>   92 app.log.debug("Config at the time: %s", app.config) 
>   93 app.exit(1) 
>   94 
>   95 
>   96 class ApplicationError(Exception): 
>   97 pass 
>   98 
>   99 
>  100 class LevelFormatter(logging.Formatter): 
>  101 """Formatter with additional `highlevel` record 
>  102 
>
> /usr/lib64/sagemath/site-packages/IPython/terminal/ipapp.pyc in 
> initialize(self=, argv=None) 
>  294 
>  295 return super(TerminalIPythonApp, 
> self).parse_command_line(argv) 
>  296 
>  297 @catch_config_error 
>  298 def initialize(self, argv=None): 
>  299 """Do actions after construct, but before starting the 
> app.""" 
>  300 super(TerminalIPythonApp, self).initialize(argv) 
>  301 if self.subapp is not None: 
>  302 # don't bother initializing further, starting subapp 
>  303 return 
>  304 # print self.extra_args 
>  305 if self.extra_args and not self.something_to_run: 
>  306 self.file_to_run = self.extra_args[0] 
>  307 self.init_path() 
>  308 # create the shell 
> --> 309 self.init_shell() 
>  self.init_shell =  > 
>  310 # and draw the banner 
>  311 self.init_banner() 
>  312 # Now a variety of things that happen after the banner 
> is printed. 
>  313 self.init_gui_pylab() 
>  314 self.init_extensions() 
>  315 self.init_code() 

[sage-support] 'Sage Crash Report

2017-10-06 Thread Lee Duke

***

IPython post-mortem report

{'commit_hash': u'5c9c918',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/usr/lib64/sagemath/site-packages/IPython',
 'ipython_version': '5.1.0',
 'os_name': 'posix',
 'platform': 
'Linux-4.12.9-300.fc26.x86_64-x86_64-with-fedora-26-Twenty_Six',

 'sys_executable': '/usr/lib64/sagemath/local/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.13 (default, Sep  5 2017, 08:53:59) \n[GCC 7.1.1 
20170622 (Red Hat 7.1.1-3)]'}


***



***

Crash traceback:

---
---
ImportError Python 2.7.13: /usr/lib64/sagemath/local/bin/python
   Fri Oct  6 11:28:35 2017
A problem occurred executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/usr/lib64/sagemath/local/bin/sage-ipython in ()
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 """
  4 Sage IPython startup script.
  5 """
  6
  7 from sage.repl.interpreter import SageTerminalApp
  8
  9 app = SageTerminalApp.instance()
---> 10 app.initialize()
    global app.initialize = SageTerminalApp.initialize of object at 0x7f9a675e1290>>

 11 app.start()

 in 
initialize(self=, argv=None)


/usr/lib/python2.7/site-packages/traitlets/config/application.pyc in 
catch_config_error(method=, 
app=, *args=(None,), 
**kwargs={})

 72 TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR = False
 73 else:
 74 raise ValueError("Unsupported value for environment 
variable: 'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to '%s' 
which is none of  {'0', '1', 'false', 'true', ''}."% _envvar )

 75
 76
 77 @decorator
 78 def catch_config_error(method, app, *args, **kwargs):
 79 """Method decorator for catching invalid config 
(Trait/ArgumentErrors) during init.

 80
 81 On a TraitError (generally caused by bad config), this will 
print the trait's

 82 message, and exit the app.
 83
 84 For use on init methods, to prevent invoking excepthook on 
invalid input.

 85 """
 86 try:
---> 87 return method(app, *args, **kwargs)
    method = 
    app = 0x7f9a675e1290>

    args = (None,)
    kwargs = {}
 88 except (TraitError, ArgumentError) as e:
 89 app.print_help()
 90 app.log.fatal("Bad config encountered during 
initialization:")

 91 app.log.fatal(str(e))
 92 app.log.debug("Config at the time: %s", app.config)
 93 app.exit(1)
 94
 95
 96 class ApplicationError(Exception):
 97 pass
 98
 99
    100 class LevelFormatter(logging.Formatter):
    101 """Formatter with additional `highlevel` record
    102

/usr/lib64/sagemath/site-packages/IPython/terminal/ipapp.pyc in 
initialize(self=, argv=None)

    294
    295 return super(TerminalIPythonApp, 
self).parse_command_line(argv)

    296
    297 @catch_config_error
    298 def initialize(self, argv=None):
    299 """Do actions after construct, but before starting the 
app."""

    300 super(TerminalIPythonApp, self).initialize(argv)
    301 if self.subapp is not None:
    302 # don't bother initializing further, starting subapp
    303 return
    304 # print self.extra_args
    305 if self.extra_args and not self.something_to_run:
    306 self.file_to_run = self.extra_args[0]
    307 self.init_path()
    308 # create the shell
--> 309 self.init_shell()
    self.init_shell = >

    310 # and draw the banner
    311 self.init_banner()
    312 # Now a variety of things that happen after the banner 
is printed.

    313 self.init_gui_pylab()
    314 self.init_extensions()
    315 self.init_code()
    316
    317 def init_shell(self):
    318 """initialize the InteractiveShell instance"""
    319 # Create an InteractiveShell instance.
    320 # shell.display_banner should always be False for the 
terminal
    321 # based app, because we call shell.show_banner() by 
hand below

    322 # so the banner shows *before* all extension loading stuff.
    323 self.shell = TerminalInteractiveShell.instance(parent=self,
    324 profile_dir=self.profile_dir,

/usr/lib64/python2.7/site-packages/sage/repl/interpreter.pyc in 
init_shell(self=)
    747 self.shell.has_sage_extensions = 

[sage-support] SageMath/Python as the scripting language for the Web

2017-10-06 Thread Jorge Manrique


Hello everyone,
I have an interactive program in Python. The program does some calculations 
with SageMath and graphs the results. The code is a bit long.
I want to embed the program on a webpage using SageCell and I wonder if I 
can leave the Python program on the web server and use an external script:


. . . . . . .
 
sagecell.makeSagecell ({
 inputLocation: '#plot'
})
 

. . . . . . .

  


Just as Brython 
 does

Any suggestions will be appreciated,
Jorge

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