An increasing number of studies in Jahn-Teller and pseudo-Jahn-Teller effects have revealed the importance of vibronic Hamiltonians with high order expansions in vibrational coordinates. This motivates us to present VHEGEN (V-ibronic H-amiltonian E-xpansion GEN-erator), a Python package that is capable of symbolically generating arbitrarily high order expansion formulas for the vibronic Hamiltonians. The program covers all > 6000 bimodal Jahn-Teller and pseudo-Jahn-Teller problems in trigonal and tetragonal symmetries. The generated expansions are correct, complete, and concise. VHEGEN is a useful program for future studies in Jahn-Teller and pseudo-Jahn-Teller effects.