It's been thought of, by many prior to the 20th century, including Jules Verne. But it hasn't actually been invented yet, as we currently envision "spaceships". What we have now are "capsules" such as Apollo, Soyuz, the Space Shuttle, and whatever the Chinese call their crewed vehicles. These "spacecraft" require monster rockets to put them into low Earth orbit, an orbit that can be ended by retro-rockets, but not modified by more than a few degrees. The Buck Rogers/Star Wars types of "spaceships" that can turn on a dime, go from one star system to the next, and seemingly never use or require fuel, have not yet been invented.
The Soviet Union created the first "capsule" that was placed into space with a person in it, but it wasn't exactly a "spaceship".
Even my "Discovery" was not a real "spaceship" because it was incapable of massive redirection of its trajectory without the use of a near pass with a planet. Fuel was definitely an issue. Our little "pods" were more like spaceships but fuel was definitely a serious factor in how long they could "fly" before they had to come back in for refueling.