These are strong words. Is this a statement of fact? Or is it a prayer? Does the author know this from personal experience? This is a tough verse. We know that those who do not live according to God's laws are cursed. We also know that it is impossible to find salvation by keeping the law-- because all of us wander. This verse makes me so thankful for the grace of God.
Studying this verse led me to Galatians 3:10-14, which is like a New Testament commentary on it:
But those who depend on the law to make them right with God are under his curse, for the Scriptures say, "Cursed is everyone who does not observe and obey all these commands that are written in God's Book of the Law." Consequently, it is clear that no one can ever be right with God by trying to keep the law. For the Scriptures say, "It is through faith that a righteous person has life." How different from this way of faith is the way of law, which says, "If you wish to find life by obeying the law, you must obey all of its commands." But Christ has rescued us from the curse pronounced by the law. When he was hung on the cross, he took upon himself the curse for our wrongdoing. For it is written in the Scriptures, "Cursed is everyone who is hung on a tree." Through the work of Christ Jesus, God has blessed the Gentiles with the same blessing he promised to Abraham, and we Christians receive the promised Holy Spirit through faith.