if by clicking you mean the drive continuously repeatedly clicks and nothing else try changing the SATA cable in the computer and try again.
if the drive works in the enclosure that means means the drive is working, that leaves the cable, motherboard, or power supply. change the sata data cable and try again, then try a different SATA port on the motherboard, then try a different power connector from the PSU.
listed in order of likelyhood