Hi all,
Thanks for your responses! Om my MacBook Pro Intel Core I7, I had to change the suggested lines of code to:
import sys
sys.path.append('/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages')
import visual
However, when this is evaluated by Sage, I get the error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_19.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -- coding: utf-8 --\n" + _support_.preparse_worksheet_cell(base64.b64decode("aW1wb3J0IHN5cwpzeXMucGF0aC5hcHBlbmQoJy9MaWJyYXJ5L0ZyYW1ld29ya3MvUHl0aG9uLmZyYW1ld29yay9WZXJzaW9ucy8yLjcvbGliL3B5dGhvbjIuNy9zaXRlLXBhY2thZ2VzJykKaW1wb3J0IHZpc3VhbA=="),globals())+"\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/private/var/folders/45/450VCFXnGmmTeo+fv0sWMk+++TI/-Tmp-/tmp3XxlCy/___code___.py", line 4, in <module>
exec compile(u'import visual
File "", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/visual/__init__.py", line 1, in <module>
from .visual_all import *
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/visual/visual_all.py", line 1, in <module>
from vis import version
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vis/__init__.py", line 3, in <module>
from .cvisual import (vector, dot, mag, mag2, norm, cross, rotate,
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vis/cvisual.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vis/cvisual.so: mach-o, but wrong architecture
I take this to mean that the visual python package has been compiled for an architecture that
is incompatible with Sage.
Note: I used the Mac OS installer at
http://vpython.org/contents/download_mac.html
to install Visual Python as a Mac OS Framework; consequently, vPython is not installed in the
same manner as most Python packages!
Regards,
Adam Hausknecht