mercurial version conflict in virtualenv and mod_wsgi

158 views
Skip to first unread message

alind

unread,
Feb 28, 2012, 11:33:18 PM2/28/12
to rhodecode
First of all thanks for the beatiful software.
Secondly,
I am trying to setup rhodecode 1.3.1 on virtualenv with mod_wsgi.
Everyting worked file until I was using paster for serving. The
moment, I tried mod_wsgi with virtualenv under apache, it started
giving versionconflict error in apache log. Then I found this thing on
rhodecode setup site,

"Note: when using mod_wsgi you’ll need to install the same version of
Mercurial that’s inside RhodeCode’s virtualenv also on the system’s
Python environment."

Mercurial on system: Version: 1.6.4
Mercurial on virtualenv: version = "2.1"
Why is this dependency and what is the workaround (if any)?

[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/paste/deploy/
loadwsgi.py", line 320, in _loadconfig
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] return
loader.get_context(object_type, name, global_conf)
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/paste/deploy/
loadwsgi.py", line 454, in get_context
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] section)
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/paste/deploy/
loadwsgi.py", line 476, in _context_from_use
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25]
object_type, name=use, global_conf=global_conf)
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/paste/deploy/
loadwsgi.py", line 406, in get_context
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25]
global_conf=global_conf)
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/paste/deploy/
loadwsgi.py", line 296, in loadcontext
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25]
global_conf=global_conf)
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/paste/deploy/
loadwsgi.py", line 328, in _loadegg
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] return
loader.get_context(object_type, name, global_conf)
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/paste/deploy/
loadwsgi.py", line 620, in get_context
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25]
object_type, name=name)
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/paste/deploy/
loadwsgi.py", line 640, in find_egg_entry_point
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25]
pkg_resources.require(self.spec)
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/distribute-0.6.10-
py2.6.egg/pkg_resources.py", line 648, in require
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] needed =
self.resolve(parse_requirements(requirements))
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] File "/home/
repo_new/rhodecode_venv/lib/python2.6/site-packages/distribute-0.6.10-
py2.6.egg/pkg_resources.py", line 550, in resolve
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25] raise
VersionConflict(dist,req) # XXX put more info here
[Tue Feb 28 17:33:22 2012] [error] [client 192.20.16.25]
VersionConflict: (mercurial 1.6.4 (/usr/lib/pymodules/python2.6),
Requirement.parse('mercurial>=2.1,<2.2'))

alind

unread,
Mar 1, 2012, 12:09:51 AM3/1/12
to rhodecode
The probem of mercurial version conflict goes away when i removes
mercurial from the system install. But then it start giving error on
version conflict of python-datatime module. There has to be a solution
for this versionconflict thing.

Marcin Kuzminski

unread,
Mar 2, 2012, 9:49:55 AM3/2/12
to rhod...@googlegroups.com
Did you try to set python path to venv in header of wsgi script ?

alind

unread,
Mar 8, 2012, 5:55:55 AM3/8/12
to rhodecode
Here is my wsgi file. Presently I have just uninstalled mercurial from
the server and its working fine for time being. What should be the
PYTHONPATH variable set to?
#=========
import site
site.addsitedir("/home/repo_new/rhodecode_venv/lib/python2.6/site-
packages/")

import os
os.environ["HGENCODING"] = "UTF-8"
os.environ['PYTHON_EGG_CACHE'] = '/home/repo_new/rhodecode/egg-cache'

#activate_this = '/home/server/.virtualenvs/rhodecode_venv/bin/
avtivate_this.py'
#execfile(activate_this, dict(__file__=activate_this))

# sometimes it's needed to set the curent dir
#os.chdir('/home/server/.virtualenvs/rhodecode_venv/')
os.chdir(os.path.dirname(__file__))


from paste.deploy import loadapp
from paste.script.util.logging_config import fileConfig

fileConfig('/home/repo_new/rhodecode/production.ini')
application = loadapp('config:/home/repo_new/rhodecode/
production.ini')
#=========

Marcin Kuzminski

unread,
Mar 10, 2012, 7:15:28 PM3/10/12
to rhod...@googlegroups.com
Are you sure that when you activate that venv the mercurial version is proper ? maybe try to make fresh vevn and using just PIP, i'd seen some troubles with easy_install and mercurial versions...
Reply all
Reply to author
Forward
0 new messages