Question

Im running a solaris server which uses supervisor to monitor some Python applications.

Previously, I could run the command:

paster serve /opt/pyapps/menuadmin/prod.ini

from any directory on the server. There were some recent issues and the /opt folder was restored from a previous backup. This folder contained all of the applications including supervisor.

Now we are facing issues where supervisor will not start the applications because of "version conflicts" in Pylons.

This is where it gets weird and it makes no sense why these errors would occur.

If I run the paster command from outside of the program directory, it will throw the version conflict error. eg:

cd /
paster serve /opt/pyapps/menuadmin/prod.ini
Traceback (most recent call last):
  File "/opt/csw/bin/paster", line 8, in <module>
    load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
  File "/opt/csw/lib/python2.6/site-packages/PasteScript-1.7.5-py2.6.egg/paste/script/command.py", line 93, in run
    commands = get_commands()
  File "/opt/csw/lib/python2.6/site-packages/PasteScript-1.7.5-py2.6.egg/paste/script/command.py", line 135, in get_commands
    plugins = pluginlib.resolve_plugins(plugins)
  File "/opt/csw/lib/python2.6/site-packages/PasteScript-1.7.5-py2.6.egg/paste/script/pluginlib.py", line 82, in resolve_plugins
    pkg_resources.require(plugin)
  File "/opt/csw/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 626, in require
  File "/opt/csw/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 528, in resolve
pkg_resources.VersionConflict: (Pylons 0.9.7 (/opt/csw/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg), Requirement.parse('Pylons>=0.10'))

But if I run the command from inside the program directory, it will run fine. eg:

cd /opt/pyapps/menuadmin/
paster serve /opt/pyapps/menuadmin/prod.ini
Starting server in PID 29902.
serving on http://127.0.0.1:3002

I absolutely cannot get my head around why this would happen!

Any thoughts or comments at all are appreciated!!!!

Was it helpful?

Solution

Based upon what you have said it seems you are running two different version of paster. The first version is running the older Pylons package 0.9.7, whilst the second has the more up to date version that meets or exceeds your app's requirements.

What I would do is first check which version of paster you are running. From outside of the project just run:

which paster

Then run the same command again within the project directory and compare the results. I suspect that you will find that the paths differ. If that is the case then all you need to do is update the version of pylons for the first version, which I'm guessing is the global install.

However, as others have commented it would be better to run apps within virtualenv, especially if as you seem to indicate you have multiple virtualenv and thus multiple projects. Trust me when I say it will save you from loads of headaches later on, from someone that didn't do this originally.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top