In Earth’s crust, pyroxenes are found in a wide range of igneous and metamorphic rocks. They are most abundant in the dark-colored igneous rocks, such as basalt and gabbro, that comprise most of the oceanic crust. Pyroxenes and plagioclase feldspar are the most abundand minerals in these rocks.
Pyroxenes are also important minerals in many peridotites. Rocks of the upper mantle are composed mainly of olivine and pyroxenes.

In the continental crust, pyroxenes are often accessory minerals in granite, rhyolite, diorite, and andesite. See the accompanying chart for a graphical representation of pyroxene presence in various igneous rocks.
Pyroxenes are not abundant in sedimentary rocks because pyroxenes rarely form at low temperatures and are very susceptible to chemical and physical weathering.