An entire international body designed for restricting trade of nuclear materials was created in response to India's first test, and the US did impose sanctions on India for their tests in the 90's.
The reason India specifically hasn't been punished much is because they otherwise have a good nuclear record and claim to want stronger non-proliferation treaties.
Nuclear Suppliers Group:
The NSG is an export control group which was created directly in response to India's first nuclear test, the amazingly named Smiling Buddha .
The NSG is tasked with tracking and controlling materials that can be used to directly or indirectly create nuclear weapons.
Since this certainly would have stopped imports of certain items controlled by the NSG, you can say that India(and many other nations) received sanctions indirectly.
In regards to India's nuclear tests in the 1990's, the US strongly condemned India and imposed pretty strict sanctions on them in 1998 .
In the following years, the US held talks with India regarding their nuclear program, though were unsuccessful in convincing India to reverse their program fully.
India's Nuclear Record:
As was explained in an answer to a similar question , the situation in India is different that in other nuclear-possible countries, such as North Korea, since they have essentially adhered to the treaty since their tests.
In the early 2000's, India and the US began working on an agreement which would allow India to begin working with the US to develop nuclear energy, with a good part of the rationale being that India has 'de facto' status as a non-proliferation nation.
Essentially, India's polcies regarding no-first-use of the weapons, lack of apparent desire to create a large stockpile, and claims that they want to sign a stronger version of the NPT meant that other nations didn't see much need to sanction or otherwise punish India for their weapons program.
politics.stackexchange.com/users/19246/Giter
There were sanctions imposed on India in response to India conducting its first successful nuclear test.
Article here (from 1998) reported the announcement .
politics.stackexchange.com/users/13162/grovkin
Why weren't any sanctions imposed on India for not signing the Treaty on the Non-Proliferation of Nuclear Weapons?
This is an absurd question.
If some one is slapped by sanction for not signing a treaty, then why broach that treaty in the first place?
A sanction can be imposed for not abiding by the rules of the treaty while being a signatory.
But, that is also too far fetched.
Partners of that treaty can only expel that signatory, nothing else.
politics.stackexchange.com/users/None/
I think all the answers so far are ignoring the herd of elephants in the room:
India* is not a threat to anyone, India has a decent human rights record, India is unlikely to supply nuclear weapons or technology to jihadists, &c.
*Feel free to substitue Israel in this if you like.
politics.stackexchange.com/users/9722/jamesqf
India, Pakistan obtained their nuclear weapons in Cold War period.
Pakistan is strictly backed by U.S. India have close ties with U.S. because, from U.S. point of view, it is some sort of counter-weight against China.
Also, some another reason not to do it - there is arguments for it, Pakistan have nuclear weapons, and have tensions with India, so India do it for defense.
So, answer is: in Cold War U.S. and USSR have many other things to do, without these sanctions.
it have rather close ties with U.S. North Korea example is full analogic, despite the fact, that North Korea do NOT have close ties with U.S.
There is also such complex question as Israel nuclear weapons, but it is much more custom situation, hardly comparable with India/Pakistan/North Korea examples
politics.stackexchange.com/users/20263/user2501323
Why weren't any sanctions imposed on India for not signing the Treaty on the Non-Proliferation of Nuclear Weapons?
Why weren't any sanctions imposed on India for not signing the Treaty on the Non-Proliferation of Nuclear Weapons?
politics.stackexchange.com
<international-relations><india><nuclear-weapons><sanctions>
politics.stackexchange.com/questions/30173
politics.stackexchange.com/users/20345/adithskv
Essentially, India's policies regarding no-first-use of the weapons, lack of apparent desire to create a large stockpile, and  claims  that they want to sign a stronger version of the NPT meant that other nations didn't see much need to sanction or otherwise punish India for their weapons program. India hasn’t been punished because it has a good nuclear record and wants a stronger non-proliferation treaty. Moreover, India is not a threat to anyone and has a good human rights’ record. 
India hasn’t been punished because it has a good nuclear record and wants a stronger non-proliferation treaty. India is not a threat to anyone and has a good human rights’ record. 