Opened 10 years ago

Closed 4 years ago

#972 closed defect (fixed)

Upgrade system python

Reported by: Elinvention Owned by:
Priority: minor Milestone:
Component: documentation Keywords: virtualenv, python, system update, bitesized
Cc: Parent Tickets:


After a system python upgrade, Mediagoblin won't be able to start any more because the local virtualenv python will still look for the old python modules (if I understood correctly). Mediagoblin will output errors like this and refuse to start:

Traceback (most recent call last):
  File "./bin/gmg", line 9, in <module>
    load_entry_point('', 'console_scripts', 'gmg')()
  File "/var/mediagoblin/mediagoblin/gmg_commands/", line 108, in main_cli
    setup_func = import_component(command_struct['setup'])
  File "/var/mediagoblin/mediagoblin/tools/", line 34, in import_component
  File "/var/mediagoblin/mediagoblin/gmg_commands/", line 21, in <module>
    from mediagoblin.gmg_commands import util as commands_util
  File "/var/mediagoblin/mediagoblin/gmg_commands/", line 18, in <module>
    from mediagoblin import app
  File "/var/mediagoblin/mediagoblin/", line 20, in <module>
    from mediagoblin.routing import get_url_map
  File "/var/mediagoblin/mediagoblin/", line 19, in <module>
    from import add_route, mount, url_map
  File "/var/mediagoblin/mediagoblin/tools/", line 20, in <module>
    from werkzeug.routing import Map, Rule
  File "/var/mediagoblin/local/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/", line 154, in <module>
  File "/var/mediagoblin/local/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/", line 67, in <module>
    from werkzeug._internal import _get_environ
  File "/var/mediagoblin/local/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/", line 15, in <module>
    from datetime import datetime, date
ImportError: No module named datetime

To update virtualenv python you can issue:

virtualenv --system-site-packages <path/to/env>

as mediagoblin user, where <path/to/env> is the path to your mediagoblin instance.

Change History (5)

comment:1 by Elrond, 10 years ago

Just to state the obvious: We should include a note in our docs somewhere in the upgrade area about what to do, if/when you upgrade your system's python.

comment:2 by Elrond, 10 years ago

Keywords: bitesized added

This really shouldn't be a biggy. Tagging bitesized.

comment:3 by Christopher Allan Webber, 9 years ago

Milestone: 0.8.0

comment:4 by dpg, 6 years ago

Is this just a matter of adding a note in the docs?

comment:5 by Ben Sturmfels, 4 years ago

Resolution: fixed
Status: newclosed

I've added docs on system Python updates in

Closing this issue now.

Note: See TracTickets for help on using tickets.