William James was born at the Astor House in New York City. He was the son of Henry James Sr., a noted and independently wealthy Swedenborgian theologian well acquainted with the literary and intellectual elites of his day. The intellectual brilliance of the James family milieu and the remarkable epistolary talents of several of its members have made them a subject of continuing interest to historians, biographers, and critics.
William James received an eclectic trans-Atlantic education, developing fluency in both German and French. Education in the James household encouraged cosmopolitanism. The family made two trips to Europe while William James was still a child, setting a pattern that resulted in thirteen more European journeys during his life. His early artistic bent led to an apprenticeship in the studio of William Morris Hunt in Newport, Rhode Island, but he switched in 1861 to scientific studies at the Lawrence Scientific School of Harvard University.
In his early adulthood, James suffered from a variety of physical ailments, including those of the eyes, back, stomach, and skin. He was also tone deaf. He was subject to a variety of psychological symptoms which were diagnosed at the time as neurasthenia, and which included periods of depression during which he contemplated suicide for months on end. Two younger brothers, Garth Wilkinson (Wilky) and Robertson (Bob), fought in the Civil War. The other three siblings (William, Henry, and Alice James) all suffered from periods of invalidism.
He took up medical studies at Harvard Medical School in 1864 (according to his brother Henry James). He took a break in the spring of 1865 to join naturalist Louis Agassiz on a scientific expedition up the Amazon River, but aborted his trip after eight months, as he suffered bouts of severe seasickness and mild smallpox. His studies were interrupted once again due to illness in April 1867. He traveled to Germany in search of a cure and remained there until November 1868; at that time he was 26 years old. During this period, he began to publish; reviews of his works appeared in literary periodicals such as the North American Review.
James finally earned his M.D. degree in June 1869 but he never practiced medicine. What he called his "soul-sickness" would only be resolved in 1872, after an extended period of philosophical searching. He married Alice Gibbens in 1878. In 1882 he joined the Theosophical Society.
James's time in Germany proved intellectually fertile, helping him find that his true interests lay not in medicine but in philosophy and psychology. Later, in 1902 he would write: "I originally studied medicine in order to be a physiologist, but I drifted into psychology and philosophy from a sort of fatality. I never had any philosophic instruction, the first lecture on psychology I ever heard being the first I ever gave".