Ask Your Question
1

Install problem app on mac os x

asked 2011-12-05 12:24:16 -0500

davdav gravatar image

updated 2011-12-06 02:03:19 -0500

kcrisman gravatar image

Hi, I've installed the app (4.7.2) on my Mac (OS 10.6.8). When I launch the app I have the following error. Could someone provide me a simple fix please? (I'm really not fluent with the Unix commands...).

Thank you in advance.

Here is what have in the Terminal console:

Sage Version 4.7.2, Release Date: 2011-10-29                       
Type notebook() for the GUI, and license() for information.    


Traceback (most recent call last):
  File "/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage//local/bin/sage-ipython", line 18, in <module>
    import IPython
  File "/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/IPython/__init__.py", line 58, in <module>
    __import__(name,glob,loc,[])
  File "/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/IPython/ipstruct.py", line 17, in <module>
    from IPython.genutils import list2dict2
  File "/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/IPython/genutils.py", line 26, in <module>
    import shlex
  File "/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python/shlex.py", line 12, in <module>
    from collections import deque
  File "/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python/collections.py", line 9, in <module>
    from operator import itemgetter as _itemgetter
ImportError: dlopen(/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/lib-dynload/operator.so, 2): Symbol not found: __PyUnicodeUCS4_AsDefaultEncodedString
  Referenced from: /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/lib-dynload/operator.so
  Expected in: flat namespace
 in /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/lib-dynload/operator.so
edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
1

answered 2012-01-14 17:55:49 -0500

lharris gravatar image

I had this same problem when trying to run Sage. My problem arose because the standard OS X python is being called instead of Sage's python, because the install script puts the path to Sage's executables AFTER /usr/bin/ in the $PATH variable.

My work-around was to open a new terminal window and enter the following two lines:

export PATH=/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/:$PATH
'/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/'/sage --notebook

This presumes you are running BASH, which is what recent versions of OS X use by default, and that you are running the Sage-4.7.2-OSX-64bit-10.6.app version of Sage; change the path to your Sage installation if you are using a different version. (I got the idea to do this from this posting on a mailing list.)

edit flag offensive delete link more

Comments

If PATH is setup incorrectly, that is a huge bug in Sage. Did you build your own or use a prebuilt binary? What does `/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/sage -c "print os.getenv('PATH')"` show?

Ivan Andrus gravatar imageIvan Andrus ( 2012-01-16 20:49:28 -0500 )edit

As noted in @LDCruise's answer, this won't work. Try `.../sage -sh` then `env | grep SAGE` and `echo $PATH`.

Ivan Andrus gravatar imageIvan Andrus ( 2012-01-19 21:41:01 -0500 )edit
0

answered 2012-01-17 05:34:13 -0500

I'm having the same problem. When I entered /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/sage -c "print os.getenv('PATH')"

I get

'import site' failed; use -v for traceback Traceback (most recent call last): File "/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/bin/sage-location", line 3, in <module> import os, sys ImportError: No module named os

edit flag offensive delete link more

Comments

Sorry. I don't know why I thought that `sage -c` would work since sage can't start up. What you should try is `.../sage -sh` then `env | grep SAGE` and `echo $PATH`.

Ivan Andrus gravatar imageIvan Andrus ( 2012-01-19 21:39:54 -0500 )edit
0

answered 2012-01-19 09:35:09 -0500

I'm having the same problem. Changing the $PATH as suggested above didn't help. Entered

/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/sage -c "print os.getenv('PATH')"

as suggested above, and got this error:

    Traceback (most recent call last):
  File "/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage//local/bin/sage-eval", line 4, in <module>
    from sage.all import *
  File "/Users/buildbot/build/sage/bsd-1/bsd_64_binary/build/sage-4.7.2/local/lib/python2.6/site-packages/sage/all.py", line 63, in <module>
ImportError: dlopen(/Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/ext/c_lib.so, 2): Library not loaded: libcsage.dylib
  Referenced from: /Applications/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/ext/c_lib.so
  Reason: no suitable image found.  Did find:
    /usr/local/lib/libcsage.dylib: stat() failed with errno=13

Has anyone had any luck using the 4.7 version, or the 32 bit version?

edit flag offensive delete link more

Comments

The fact that I see `/Users/buildbot/build/` in the backtrace makes me think that Sage didn't get properly relocated. The first time it runs it will spend quite a long time changing certain paths. I don't know all the details, but it warns not to be interrupted. If it did I think it would end up with something like the above. Did you perchance force quit it the first time it ran or something? Or perhaps it crashed. Anyway, one thing you could try is deleting the app and then "re-installing" from the disk image. That should reset where it thinks it is and run the relocation process.

Ivan Andrus gravatar imageIvan Andrus ( 2012-01-19 21:36:12 -0500 )edit
0

answered 2012-01-22 05:32:58 -0500

Ivan Andrus gravatar image

Georg S. Weber found a problem with the app which is being tracked as ticket #12161. Hopefully this is your problem since we have a fix for it. :-) The problem should only manifest itself if you have not successfully run (a sufficiently new version of) the Sage notebook before. One way to work around it is to start Terminal.app _before_ running Sage. To be more precise:

  1. Quit Sage.app and Terminal.app if they are open.
  2. Start Terminal.app (located at /Applications/Utilities/Terminal.app)
  3. Start Sage.app
  4. A new window should open in Terminal.app and ask you for a password for the notebook

At the very least this might be @lharris's problem.

edit flag offensive delete link more

Comments

There is a new 4.8 binary up which was jury-rigged to fix this problem. When you try to download it from a mirror it will be called `...-app.p0.dmg`, otherwise it's the old one.

Ivan Andrus gravatar imageIvan Andrus ( 2012-03-21 10:29:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-12-05 12:24:16 -0500

Seen: 1,122 times

Last updated: Jan 22 '12