[Tex/LaTex] How to fix “LaTeX Error: File `somepackage.sty’ not found”

miktexpackagestexworks

I am using TeXworks 0.4.5 r1280 with MikTeX 2.9 on Windows 7 64-bit. When I add

\usepackage{datetime}

and try to typeset the document, I get a dialog window like this:

Package Installation Window

I select "Install", confirm UAC request and then get the following error on the console:

! LaTeX Error: File `datetime.sty' not found.

If I try to typeset the document again – the dialog and the error appear again.

Same thing happens when I've tried installing wrapfig and a few other packages at random: cases, comma, dowith, microtype. Other packages have installed fine before. What is wrong with my setup? Please let me know if you need more info about my setup in comments.

I've tried this solution: *.sty file not found. Didn't work.

Best Answer

Try to change the repository using the button Change.

Select another one and check you Internet connection.

Also, you can get it from CTAN.

Note that you can decide if you want to see that dialog window every time or not.

Related Question