As others have said, build a positive mindset first. You're angry and frustrated. We understand. Most guys have known it at some point. But taking it out on yourself only hurts.. yourself. It's OK to be angry, but use that as fuel and motivation to build yourself up to where you want to be, and not to self-destruct through bad habits or self-loathing. You only cheat yourself by not acting in a positive way for you. The thing is, as others have said, sex is overrated. In the context of a solid relationship it can be good, but it shouldn't be the centre of your world.. just the icing on the cake of a good relationship, and ultimately for creating babies. Modern society idolizes the act and doesn't celebrate the healthy context surrounding it.. because sex and quick thrills sell.. long term goals and morality don't.
The thing is when you go through this struggle and carve yourself out good, you will be happier for yourself, and as a bonus you will be receptive to inviting female presence in to your life.. but at that point you'll be content enough that it doesn't matter if you have someone or not anyway! On a side note most women have little idea what it means to be a man, to light a fire under your own ass and conquer your inertia, self-loathing, and inner demons that hold you back, and become something great. They just don't. But once you find that drive inside yourself and begin to own it, they see it in you because it affects the way you hold yourself, your composure, your words, everything. That's what they're attracted to, the dynamic male energy, energy that blasts forth from nothing to create something.
Get in the gym. You will feel better because you're exercising. You will grow and that lifts you up in many ways. You can see the results of YOUR effort and success. It's the best thing you can do and its a wise choice in terms of time and energy. I've gained 20lbs in the last 9 months, 3 hours of gym a week, eating healthy. The hardest part is diet and getting enough sleep! Seriously, channel your anger there and let yourself succeed.
EDIT: Get yourself some proper material for the mind too. There's SO much free stuff available that can change your life it's unreal, and most people have no idea! I seriously can't believe it sometimes. Read up on psychology, how to be success, how your mind works, how you can change your own direction. Here's a book to get you started and acquainted with the idea of success:
http://eventualmillionaire.com/Resources/ThinkandGrowRichebook.pdf