The paper provides a homological algebraic foundation for semi-infinite cohomology. It is proved that semi-infinite cohomology of infinite dimensional Lie algebras is a two-sided derived functor of a functor that is intermediate between the functors of invariants and coinvariants. The theory of two-sided derived functors is developed. A family of modules including a module generalizing the universal enveloping algebra appropriate to the setting of two sided derived functors is introduced. A vanishing theorem for such modules is proved.