The Trans-Pacific Partnership is not dead. Not yet, anyway. The Obama administration, like its counterpart in Tokyo, is determined to press ahead with ratification by the end of the year, specifically in the “lame duck” session between the November elections and the inauguration next January. It may be the only chance the United States has for long time.

Both presidential candidates have repeatedly voiced their opposition to the TPP over domestic concerns about its impact on jobs and the economy. That’s an important discussion, but the next president will want a formal framework to govern commerce in Asia, the world’s fastest growing market, and for now the TPP is still the most likely framework. Certainly, the next president will probably prefer to have the TPP in hand, rather than floating in the air, on their first trip to Asia.

In that case, the candidates should hope (probably silently) that the TPP is ratified before they take office. Two things need to come first: the Obama administration needs to reach agreements with relevant Republican congressional leaders on their objections to the agreement and then persuade enough Democrats to vote in favor.

Easier said than done, but last year’s passage of Trade Promotion Authority (TPA) makes the path more straightforward because the TPP will be safe from amendments and only require simple majority votes in both houses of Congress. Negotiations with Republican leaders have been making progress throughout the year and the administration has set up a “war room” for the ratification process like it did for NAFTA to coordinate between the White House and relevant Cabinet departments.

The question is whether the effort can deliver the votes. The TPA vote was a rare, but welcome, example of the White House and GOP leadership working together effectively, but given the rhetoric in the campaign, the earlier effort will not just need to be repeated, but probably redoubled for the TPP to pass.

The problem is that the lame duck session may be the only chance for U.S. ratification for a very long time — Congress won’t be able to take a difficult vote on trade for at least a year and probably longer. Using the June 2015 TPA votes as a model, 13 “ayes” in the Senate are in play between the current election and the next in 2018. In the current election, senators representing the eight “toss up” states (those with an equal chance of going Democrat or Republican) voted for TPA 7-1.

Two of the three sitting members of the House of Representatives running for those seats voted against TPA and the other candidates have come out against the TPP or have not taken a position. Notably, Rob Portman, the incumbent GOP senator from Ohio and former U.S. trade representative, came out against the TPP because the political costs of standing by the agreement are too great in the Rust Belt.

As for the next administration, it’s assumed that the president will eventually flip their opposition to the TPP, either after the furor has calmed or once side agreements have been reached on relevant issues. But it’s difficult to see when that happens — the first 100 days of the new administration, as always, will be dedicated to the new president’s most important initiatives. Other issues that may be in play next year like immigration, infrastructure or corporate tax reform will be difficult and contentious, probably squeezing out room for the TPP (it’s also worth remembering that recent Congresses have been famously unproductive).

The 2018 midterm election year then follows, and Democrats will have 24 Senate seats in play, almost half of their entire caucus, and six of these members supported TPA. The massive number of seats in play puts tremendous pressure on Senate Democratic leadership to protect and maybe even expand their seats, and it almost certainly means that 2018 will focus on Democratic priorities or at least aim to protect members from difficult votes like the TPP.

The Congress that follows the 2018 midterm elections doesn’t bode well either since that will be the one before the next president’s re-election campaign. It’s unlikely that the president will want to renege on promises that may cost support from vital constituencies like organized labor and other trade skeptical groups.

Renegotiating the agreement may help the next president save face domestically if they try to flip their position, but there’s absolutely no appetite among the other 11 states to reopen the talks. Bilateral side agreements may be possible, but an agreement on currency issues — at the top of many skeptics’ wish lists — is a nonstarter for Japan and others. Besides, much of the left’s opposition to the agreement is fundamental to questions of globalization and liberalized trade — renegotiation won’t be able to answer to that.

So will the TPP get passed by the end of Obama’s presidency? Passage will require a considerable amount of difficult work and cooperation on a contentious issue that’s taken a beating in the presidential campaign. There’s certainly a path to ratification, but it’s an extremely narrow path and there’s almost no room for error. The next few months will be vital.

Paul Nadeau is a private secretary for a member of the Diet’s Lower House.