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/", 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/", line 141, in <module>
  File "/Applications/", 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/", 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/", line 7, in <module>
    import argparse
  File "/Applications/", line 85, in <module>
    import collections as _collections
  File "/Applications/", line 9, in <module>
    from operator import itemgetter as _itemgetter, eq as _eq
ImportError: dlopen(/Applications/, 2): Symbol not found: __PyUnicodeUCS4_AsDefaultEncodedString
  Referenced from: /Applications/
  Expected in: flat namespace
 in /Applications/
edit retag flag offensive close merge delete


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