A slow-rolling scalar field (Q\ensuremath{\equiv}quintessence) with potential energy ${V}_{Q}\ensuremath{\sim}(3\ifmmode\times\else\texttimes\fi{}{10}^{\ensuremath{-}3}\mathrm{eV}{)}^{4}$ has been proposed as the origin of an accelerating universe at present. We investigate the effective potential of Q in the framework of a supergravity model including the quantum corrections induced by generic (nonrenormalizable) couplings of Q to the gauge and charged matter multiplets. It is argued that the K\"ahler potential, superpotential, and gauge kinetic functions of the underlying supergravity model are required to be invariant under the variation of Q with an extremely fine accuracy in order to provide a working quintessence potential. Applying these results for string or M theory, we point out that the heterotic M theory or type-I string axion can be a plausible candidate for quintessence if (i) it does not couple to the instanton number of gauge interactions not weaker than those of the standard model and (ii) the modulus partner $\mathrm{Re}(Z)$ of the periodic quintessence axion $\mathrm{Im}(Z)\ensuremath{\equiv}\mathrm{Im}(Z)+1$ has a large vacuum expectation value: $\mathrm{Re}(Z)\ensuremath{\sim}(1/2\ensuremath{\pi})\mathrm{ln}{(m}_{3/2}^{2}{M}_{\mathrm{Planck}}^{2}{/V}_{Q}).$ It is stressed that such a large $\mathrm{Re}(Z)$ gives the gauge unification scale at around the phenomenologically favored value $3\ifmmode\times\else\texttimes\fi{}{10}^{16}$ GeV. To provide an accelerating universe, the quintessence axion should be near the top of its effective potential at present, which requires severe fine tuning of the initial condition of Q and $\mathrm{Q\ifmmode \dot{}\else \.{}\fi{}}$ in the early universe. We discuss a late time inflation scenario based on the modular and $\mathrm{CP}$ invariance of the moduli effective potential, yielding the required initial condition in a natural manner if the K\"ahler metric of the quintessence axion superfield receives a sizable nonperturbative contribution.