WebFaction
Community site: login faq

I successfully set up a mod_wsgi 3.4 / Python 2.7 site and installed web.py. Everything was running great on Friday, but it's broken now. It appears that that there were some breaking changes in Python 2.7.4, which match my errors (see: http://isotope11.com/blog/fix-your-python-2-dot-7-4-maxrepeat-importerror-issues) and info from my apache error log below.

Since nothing in the traceback references my code and I didn't make any changes, I'm thinking that something changed behind the scenes. Unfortunately, I'm not sure what to do to fix this problem since I didn't install python myself (I used the installer via the web-based control panel). Any help is greatly appreciated!

In case it's useful, "python --version" return 2.7.5, and I'm using Python 2.7 instead of 3.x because (as far as I can tell) webpy doesn't support Python 3.x. Thanks for your help!

ImportError: cannot import name MAXREPEAT
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site.py", line 548, in <module>
    main()
  File "/usr/local/lib/python2.7/site.py", line 530, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/local/lib/python2.7/site.py", line 266, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/local/lib/python2.7/site.py", line 241, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/local/lib/python2.7/site.py", line 231, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/local/lib/python2.7/sysconfig.py", line 516, in get_config_var
    return get_config_vars().get(name)
  File "/usr/local/lib/python2.7/sysconfig.py", line 449, in get_config_vars
    import re
  File "/usr/local/lib/python2.7/re.py", line 105, in <module>
    import sre_compile
  File "/usr/local/lib/python2.7/sre_compile.py", line 14, in <module>
    import sre_parse
  File "/usr/local/lib/python2.7/sre_parse.py", line 17, in <module>
    from sre_constants import *
  File "/usr/local/lib/python2.7/sre_constants.py", line 18, in <module>
    from _sre import MAXREPEAT

asked 02 Jun '13, 01:02

davidm
12
accept rate: 0%


This was caused on some mod_wsgi applications after a recent server-wide Python upgrade, and in most cases simply restarting the WSGI application was enough to resolve the problem.

If this doesn't work, please submit a support ticket and give us permission to inspect your application setup, and we may be able to provide more information. Hope that helps!

permanent link

answered 02 Jun '13, 02:15

ryans ♦♦
5.0k93360
accept rate: 43%

I restarted apache2 in the webapps/<application>/apache2/bin directory and everything is working again. Thanks!

(02 Jun '13, 15:23) davidm

Have the same problem, but your solution is not working for me. I executed '/etc/init.d/apache2 restart' and it still gives me the same error. Btw, I'm not using webpy.

(19 Jun '13, 06:55) Tony Pershin

@Tony - you can't run stuff in /etc/init.d on WebFaction's servers, because you're not the root user.

(19 Jun '13, 14:32) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×52
×3

question asked: 02 Jun '13, 01:02

question was seen: 1,929 times

last updated: 19 Jun '13, 14:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM