Is there are known fix for these Python-related install errors on MacOS10.8.5?

asked 2016-11-29 04:56:42 -0500

marc3131 gravatar image

updated 2017-01-10 15:21:38 -0500

FrédéricC gravatar image

Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/posixpath.py", line 80, in join if b.startswith(sep): TypeError: startswith first arg must be str or a tuple of str, not bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/SageMath-7.2.app/Contents/Resources/sage/relocate-once.py", line 141, in <module>
    p('src/build/cython_debug/cython_debug_info_sage.symbolic.getitem').substitute().save()
  File "/Applications/SageMath-7.2.app/Contents/Resources/sage/relocate-once.py", line 129, in __call__
    filename = os.path.join(self.root_path, filename)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/posixpath.py", line 91, in join
    raise TypeError("Can't mix strings and bytes in path components.")
TypeError: Can't mix strings and bytes in path components.
Traceback (most recent call last):
  File "/Applications/SageMath-7.2.app/Contents/Resources/sage/src/bin/sage-notebook", line 7, in <module>
    import argparse
  File "/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python/argparse.py", line 85, in <module>
    import collections as _collections
  File "/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python/collections.py", line 9, in <module>
    from operator import itemgetter as _itemgetter, eq as _eq
ImportError: dlopen(/Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so, 2): Symbol not found: __PyUnicodeUCS4_AsDefaultEncodedString
  Referenced from: /Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so
  Expected in: flat namespace
 in /Applications/SageMath-7.2.app/Contents/Resources/sage/local/lib/python2.7/lib-dynload/operator.so
edit retag flag offensive close merge delete

Comments

Your error makes it clear you have something mixing Sage's Python and your system opt Python. You may have to rename opt to something else - this is definitely necessary for building Sage, maybe also for running on your machine. In any case you may want to build from scratch if you want the most recent Sage - I don't think we currently have a buildbot for 10.8.

kcrisman gravatar imagekcrisman ( 2016-11-29 08:17:42 -0500 )edit

Please indicate what command you ran before getting this error.

slelievre gravatar imageslelievre ( 2016-11-29 09:11:11 -0500 )edit

Please indicate how you installed Sage: using binaries? building from source?

slelievre gravatar imageslelievre ( 2016-11-29 09:12:01 -0500 )edit

(My guess this is at startup?)

kcrisman gravatar imagekcrisman ( 2016-11-29 15:18:44 -0500 )edit