Hi Aleksey, On Tue, Jul 14, 2009 at 7:46 PM, Aleksey Gogolev<aleksey.gogo...@gmail.com> wrote: > > Hi Minh, > > Thank you! > I entered the command and got the same output as yours, but still no luck :( > After I restarted Sage and tried to load library I got the ImportError: > > sage:r.library("cluster") > --------------------------------------------------------------------------- > ImportError Traceback (most recent call last) > > /root/sage-4.0.2-linux-CentOS_release_5.2_Final-i686-Linux/<ipython > console> in <module>() > > /root/sage-4.0.2-linux-CentOS_release_5.2_Final-i686-Linux/local/lib/python2.5/site-packages/sage/interfaces/r.pyc > in library(self, library_name) > 554 ret = self.eval('require("%s")'%library_name) > 555 if 'there is no package' in ret: > --> 556 raise ImportError, "there is no package called > '%s'"%library_name > 557 else: > 558 try: > > ImportError: there is no package called 'cluster' > > I guess it's also some newbie mistake.
Not at all; you're not doing anything wrong. This is a known error; see ticket #6379 at http://www.sagetrac.org/sage_trac/ticket/6379 which already has a patch and positive review. But after applying that patch, installing cluster, restart Sage, and import the library cluster, Sage still doesn't recognize the cluster package. For example, here is what I did under Sage 4.1: sage: hg_sage.apply("http://www.sagetrac.org/sage_trac/raw-attachment/ticket/6379/trac_6379-Rdoctest.patch") <applying the above patch> sage: exit Exiting SAGE (CPU time 0m0.09s, Wall time 0m18.86s). [mv...@sage sage-4.1-sage.math.washington.edu-x86_64-Linux]$ ./sage -br main <now install cluster> sage: r.install_packages("cluster") <now restart Sage> sage: exit Exiting SAGE (CPU time 0m0.50s, Wall time 0m22.15s). [mv...@sage sage-4.1-sage.math.washington.edu-x86_64-Linux]$ ./sage -br main <now import the package cluster> sage: r.library("cluster") --------------------------------------------------------------------------- ImportError Traceback (most recent call last) /home/mvngu/.sage/temp/sage.math.washington.edu/16587/_home_mvngu__sage_init_sage_0.py in <module>() /scratch/mvngu/sage-4.1-sage.math.washington.edu-x86_64-Linux/local/lib/python2.6/site-packages/sage/interfaces/r.pyc in library(self, library_name) 557 # not all warnings (e.g. "closing unused connection 3") are fatal 558 if 'library(' in ret: # locale-independent key-word --> 559 raise ImportError, "%s"%ret 560 else: 561 try: ImportError: Loading required package: cluster Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called 'cluster' The error message is much "friendlier" than previously. However, from the output I suspect that cluster has not been installed in a directory where R (the one bundled with Sage) recognizes. Just a guess. Anyway, from the error message you posted above, it looks to me that you have installed Sage as root. In fact in the root home directory /root. This is *strongly* discouraged for security reasons. If you're the only person using Sage on your system, then you should install Sage as a regular user, not as a superuser. If other people on your system will be using Sage, then you can install Sage in /usr/local/bin/ or something like that, but I don't recommend the directory /root. -- Regards Minh Van Nguyen --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---