[lldb-dev] ImportError: cannot import name MAXREPEAT

Enrico Granata egranata at apple.com
Sun Dec 1 10:57:34 PST 2013


Caveat: it is not really supported to use LLDB with anything but the Python that ships with OSXFYI: this is the most commonly seen symptom of changing your Python and then using LLDB - the MAXREPEAT must be some awkward piece of Python magic :-)


Given the above, what follows is totally untested, and might be significantly off track, but did you check whether your PYTHON_PATH matches your custom Python install? That, and does your Current symlink in Python.framework correctly match your installed Python?
Also, it looks like this code is trying to figure out a USER_BASE variable right before failing.. I would google for that and see what it is, what it does, and how you can set it up correctly for a custom Python build.


Good luck!


- Enrico

On 12/01/13, Peng Yu  <pengyu.ut at gmail.com> wrote:
> Hi,
> 
> I have a new version of python installed. When I start lldb, I see the
> following error. Does anybody how to fix the problem while still keep
> /Library/Frameworks/Python.framework/Versions/2.7/bin/python as the
> default python? Thanks.
> 
> ~/linux/test/cpp/gdb/deref$ cd
> ~$ which python
> /Library/Frameworks/Python.framework/Versions/2.7/bin/python
> ~$ lldb
> Traceback (most recent call last):
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
> line 563, in <module>
>     main()
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
> line 545, in main
>     known_paths = addusersitepackages(known_paths)
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
> line 278, in addusersitepackages
>     user_site = getusersitepackages()
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
> line 253, in getusersitepackages
>     user_base = getuserbase() # this will also set USER_BASE
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
> line 243, in getuserbase
>     USER_BASE = get_config_var('userbase')
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py",
> line 472, in get_config_var
>     return get_config_vars().get(name)
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py",
> line 405, in get_config_vars
>     import re
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py",
> line 105, in <module>
>     import sre_compile
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.py",
> line 14, in <module>
>     import sre_parse
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.py",
> line 17, in <module>
>     from sre_constants import *
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.py",
> line 18, in <module>
>     from _sre import MAXREPEAT
> ImportError: cannot import name MAXREPEAT
> 
> -- 
> Regards,
> Peng
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20131201/e3186e8f/attachment.html>


More information about the lldb-dev mailing list