Ask Your Question

kd's profile - activity

2018-01-25 14:52:02 +0200 received badge  Famous Question (source)
2017-06-24 23:31:52 +0200 received badge  Popular Question (source)
2017-06-24 23:31:52 +0200 received badge  Notable Question (source)
2014-06-25 10:37:07 +0200 received badge  Student (source)
2014-01-08 15:14:22 +0200 received badge  Famous Question (source)
2013-04-21 07:49:50 +0200 received badge  Notable Question (source)
2013-02-25 02:42:58 +0200 received badge  Popular Question (source)
2012-09-05 12:07:29 +0200 asked a question error in installing R packages

Hello,

Could anyone tell me how to install R packages in Sage? I fail it as follows:


$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.7.4
BuildVersion:   11E53 
$ hdiutil mount /Users/me/Downloads/sage-5.2-OSX-64bit-10.6-x86_64-Darwin.dmg
$ cp -R -P /Volumes/sage-5.2-OSX-64bit-10.6-x86_64-Darwin/sage /Applications
$ open /Applications/sage/sage
 :
 :
$ 
$ sage
----------------------------------------------------------------------
| Sage Version 5.2, Release Date: 2012-07-25                         |
| Type "notebook()" for the browser-based notebook interface.        |
| Type "help()" for help.                                            |
----------------------------------------------------------------------
sage: 
sage: quit
Exiting Sage (CPU time 0m0.05s, Wall time 0m6.00s).
$ 
$ sage -R
R version 2.14.0 (2011-10-31)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-apple-darwin10.8.0 (64-bit)
 :
 :
> install.packages('coda')
 :
 :
trying URL 'http://cran.ism.ac.jp/src/contrib/coda_0.15-2.tar.gz'
Content type 'application/x-gzip' length 73937 bytes (72 Kb)
opened URL
==================================================
downloaded 72 Kb

* installing *source* package ‘coda’ ...
** package 'coda' successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
Error in if (file.info(codeFile)["size"] == file.info(loaderFile)["size"]) warning("package seems to be using lazy loading already") else { : 
  missing value where TRUE/FALSE needed
ERROR: lazy loading failed for package ‘coda’
* removing ‘/Applications/sage/local/lib/R/library/coda’

The downloaded packages are in 
    ‘/private/var/folders/ch/p_433hf96vq2qm72w1gg3mmc0000gn/T/RtmpVPLwTU/downloaded_packages’ 
Warning message:
In install.packages("coda") :
   installation of package 'coda' had non-zero exit status 
> 
> q()
Save workspace image? [y/n/c]: n
$ 
$ sage -f r
Calling sage-spkg on 'r'
r-2.14.0.p3
====================================================
Extracting package /Applications/sage/spkg/standard/r-2.14.0.p3.spkg
-rw-r--r--@ 1 kkondo  admin  107  7 27 23:26 /Applications/sage/spkg/standard/r-2.14.0.p3.spkg
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
Error: failed to extract /Applications/sage/spkg/standard/r-2.14.0.p3.spkg
$ 
2012-09-02 12:58:13 +0200 answered a question how to execute *.sage files?

Thank you for answer. I am now satisfied by another trial with a "print" command:


$ cat test2.sage
var('x')
assume(x > 0)
print bool(sqrt(x^2) == x)
$ sage test2.sage
True
$
2012-09-02 05:59:32 +0200 asked a question how to execute *.sage files?

Hello,

Could anyone tell me how to execute *.sage files? I fail it as follows:


% sw_vers
ProductName:    Mac OS X
ProductVersion: 10.7.4
BuildVersion:   11E53 
$ hdiutil mount /Users/me/Downloads/sage-5.2-OSX-64bit-10.6-x86_64-Darwin.dmg
$ cp -R -P /Volumes/sage-5.2-OSX-64bit-10.6-x86_64-Darwin/sage /Applications
$ open /Applications/sage/sage
 :
 :
$ 
$ sage
----------------------------------------------------------------------
| Sage Version 5.2, Release Date: 2012-07-25                         |
| Type "notebook()" for the browser-based notebook interface.        |
| Type "help()" for help.                                            |
----------------------------------------------------------------------
sage: 1 + 1
2
sage: quit
Exiting Sage (CPU time 0m0.05s, Wall time 0m6.00s).
$ 
$ env | grep '/sage'
LD_LIBRARY_PATH=/Applications/sage/local/lib:
SAGE_ROOT=/Applications/sage
$ cat test.sage
1 + 1
$ sage test.sage
$ ls -d test.*
test.py     test.sage
$ cat test.py
# This file was *autogenerated* from the file test.sage.
from sage.all_cmdline import *   # import sage library
_sage_const_1 = Integer(1)
_sage_const_1  + _sage_const_1 
$ $SAGE_ROOT/local/bin/python test.py
Traceback (most recent call last):
  File "test.py", line 2, in <module>
    from sage.all_cmdline import *   # import sage library
  File "/Applications/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py", line 14, in <module>
    from sage.all import *
  File "/Applications/sage/local/lib/python2.7/site-packages/sage/all.py", line 61, in <module>
    from sage.ext.c_lib import _init_csage, sig_on_count
ImportError: dlopen(/Applications/sage/local/lib/python2.7/site-packages/sage/ext/c_lib.so, 2): Library not loaded: libcsage.dylib
  Referenced from: /Applications/sage/local/lib/python2.7/site-packages/sage/ext/c_lib.so
  Reason: image not found
$