Python Home Directory on Windows / Multiple Version Issues

I am using Python 3 for development and CollabNet Subversion Edge as version control software. Subversion Edge comes with a small program called ViewVC, which is written in Python 2, which is also directly related to it. There is a system environment variable called PYTHONHOME.

  • If it is installed in the Python 2 distribution from Subversion Edge, my Python 3 will not start (not even IDLE), but will provide a runtime error message.
  • If it is installed in Python 3, ViewVC does not work.

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

+4
source share
3 answers

You do not need to install PYTHONHOME at all. Python uses it (if installed) to find its installation. As a rule, he should be able to find it without this variable, as well: by looking at the path name of the python executable and, otherwise, by looking at the registry.

+2
source

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

0
source

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

BTW, the PYTHONHOME variable is added for mod_python to work correctly (which serves as ViewVC). If you can find another way to get mod_python to work, you can try this.

0
source

Source: https://habr.com/ru/post/1332756/


All Articles