Question

I'm using Python 3 for developing and CollabNet Subversion Edge as versioning software. Subversion Edge comes with a little program called ViewVC which is written in Python 2, which is also directly bundled with it. There is a system environment variable called PYTHONHOME.

  • If it is set to the Python 2 distribution from Subversion Edge, my Python 3 won't start (not even IDLE), instead giving a runtime error messagebox.
  • If it is set to Python 3, ViewVC doesn't work.

Is there a way to make both work at the same time?

Was it helpful?

Solution

You shouldn't need to set PYTHONHOME at all. Python uses it (if set) to locate its installation. Typically, it should be able to locate it without this variable, as well: by looking at the path name of the python executable, and, failing that, by looking into the registry.

OTHER TIPS

Write a .bat or cmd file that saves the value of the PYTHONHOME env var, invokes ViewVC and wait for it to finish, then restores PYTHONHOME to the saved value.

Have you considered changing the Subversion Edge services to run as a specific user account, and then move the PYTHONHOME environment variable to a user-level variable for that account only? As opposed to a system-wide variable? It seems like it should work.

BTW, the PYTHONHOME variable is added for mod_python to work properly (which is what serves ViewVC). If you can find another way to get mod_python to work, then you could try that.

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