I am having trouble adding a Mercurial VCS root to a TeamCity Project. When I enter the repository information and click 'Test Connection' the pop-up says 'Connection Failed', shows me a message 'stderr: abort: couldn't find mercurial libraries in [...', ending with the message '(check your install and PYTHONPATH)'.
I am able to copy and paste the command from the error pop-up to the command line and mercurial works as expected. I have read that TeamCity should have no problem using Mercurial if it is working from the command line.
I have attempted to export the PYTHONPATH environment variable directly in the startup.sh and the catalina.sh with no change after restarting TeamCity. I have also been very careful to ensure the hg executable used by TeamCity is the same one being used on the command line.
What am I missing?