Barton was due to hold further talks with Hammers boss Slaven Bilic this week about a contract at Upton Park following his release by QPR.
But in a video posted online he said: “For this moment in time, it’s just not meant to be. I really felt I could have offered something to West Ham and you’re building a good squad there.”
Club chairman David Gold added further confirmation by writing on Twitter: “Despite the speculation, Joey Barton will not be joining West Ham United.”
Barton, 32, was one of six players released by QPR following their relegation from the Premier League and had been training with the Hammers but will not be joining them.
“I want to thank all the West Ham fans who sent me kind messages on social media – there were a few who were not so kind but that’s par for the course with me these days,” he said.
“So I want to thank the people who took the time to send me those messages. I thought West Ham would be a good fit for me, it’s a good football club and the fans are passionate.
“Despite a few having reservations, I felt I could have really done well there. I wish the football club all the best going forward and I think these are exciting times for West Ham.
“There are no hard feelings.”