Skip to content Skip to sidebar Skip to footer

Importerror: Cannot Import Name Maxrepeat With Cx_freeze

I'm running into an issue with cx_Freeze when running a frozen application (works fine unfrozen). When running the program it results in the following traceback: Traceback (most re

Solution 1:

I encountered this problem when I just upgraded from ubuntu 12.10 to 13.04, and I fixed this by copying the /usr/bin/python to /path/to/my/env/bin/, and it worked just fine

cp /user/bin/python /path/to/my/env/bin/

or, there's a more elegant way to fix this(reference):

mkvirtualenv <existing virtualenv name>

Solution 2:

_sre is a built in module, so there's no file to include for it, but it doesn't have a MAXREPEAT attribute in Python 2.7.3:

>>> import _sre
>>> _sre
<module '_sre' (built-in)>
>>> _sre.MAXREPEAT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module'object has no attribute 'MAXREPEAT'

My best guess is that your frozen copy somehow has the standard library .py modules from Python 2.7.4, but the compiled Python interpreter from 2.7.3 or an earlier version. I see you're working from /usr/local - maybe it's picking up an older version from /usr.

Solution 3:

Solution 4:

I had the same problem recently. Setting LD_LIBRARY_PATH= solved the problem.

Solution 5:

I was using cx_freeze 4.3.2 on my win 8 machine and it was always showing ImportError: cannot import name MAXREPEAT with cx Freeze if I ever tried to freeze a non built-in module, and once I downloaded version 4.3.1, it works, I'm able to freeze my all python 3.3 programs without any problem now.

Post a Comment for "Importerror: Cannot Import Name Maxrepeat With Cx_freeze"