Having a regular tennis game or scheduled workout makes it easier to be consistent about practice. For those times when you don't have someone to hit against, don't forget about your other options. Yes, it's not the same as playing with a real person, but hitting against the wall, or against a ball machine, will still give you a good workout.
Play Against the Wall
The infamous "wall". It's what you had to do in school when you were just beginning to learn tennis. It's really hard to beat the wall because the harder you hit the ball, the harder it comes back. Unlike an opponent who can make mistakes, the wall keeps it coming back. Though it may seem boring, it's actually good practice for players of all levels.
Hit on a Ball Machine
Same is true if you're hitting against a ball machine. You don't always get a good read off the machine as far as spin and trajectory, but the ball does come consistently. The more advanced machines have multiple speeds and an oscillator which allow you to vary the height and angle of the ball so it's not always in the same place.
Practice With a Purpose
If you find yourself wanting to play tennis, with no partner or opponent in sight, don't give up on the idea of getting in some good practice. You can have a great workout against the wall or ball machine if you practice with a purpose. Work on patterns and consistency, stroke production and racquet preparation, footwork and concentration. Take a basket of balls out to the court and work on serves, hitting kick, slice and flat. You can also practice groundstrokes by dropping a ball and hitting short or deep, with topspin or slice. Against the wall, play little games, work on control and pace.
Work on Your Strokes
Working out by yourself gives you extra time to think and focus on your stroke production. You can also work on your concentration by isolating on just one thing at a time without having to worry about your partner. Think about footwork and movement, hitting half-speed or quarter-speed, and moving from side to side.
The next time you can't find a practice partner, go out and try to beat the wall or the ball machine. You can't intimidate it. You can't overpower it. You can't outplay it. The ball always comes back. If you are able to master hitting against the wall, even if you can't beat it, this will do great things to improve your game.
Have fun on the courts!