Opened 5 years ago

Last modified 22 months ago

#972 new defect

Upgrade system python

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

Description

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('mediagoblin==0.7.1.dev', 'console_scripts', 'gmg')()
  File "/var/mediagoblin/mediagoblin/gmg_commands/__init__.py", line 108, in main_cli
    setup_func = import_component(command_struct['setup'])
  File "/var/mediagoblin/mediagoblin/tools/common.py", line 34, in import_component
    __import__(module_name)
  File "/var/mediagoblin/mediagoblin/gmg_commands/shell.py", line 21, in <module>
    from mediagoblin.gmg_commands import util as commands_util
  File "/var/mediagoblin/mediagoblin/gmg_commands/util.py", line 18, in <module>
    from mediagoblin import app
  File "/var/mediagoblin/mediagoblin/app.py", line 20, in <module>
    from mediagoblin.routing import get_url_map
  File "/var/mediagoblin/mediagoblin/routing.py", line 19, in <module>
    from mediagoblin.tools.routing import add_route, mount, url_map
  File "/var/mediagoblin/mediagoblin/tools/routing.py", 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/__init__.py", line 154, in <module>
    __import__('werkzeug.exceptions')
  File "/var/mediagoblin/local/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/exceptions.py", 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/_internal.py", 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.

Subtickets

Change History (4)

comment:1 Changed 5 years ago by Elrond

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 Changed 5 years ago by Elrond

Keywords: bitesized added

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

comment:3 Changed 5 years ago by Christopher Allan Webber

Milestone: 0.8.0

comment:4 Changed 22 months ago by dpg

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

Note: See TracTickets for help on using tickets.