If you have installed and used pyenv before, this plugin would be helpful for you.
It is not well documented. I wrote about it quickly in Chinese with a screenshot:
If you do not know about Chinese, just skip the Chinese character, the rest part should still make sense.
If the plugin is helpful, it could be maintained as a TeXmacs built-in plugin later.