'LaTeX error related to tcolorbox.sty not found

I have a problem with LaTeX whenever I try to download the file in PDF. When I try to do that, it gives me the following error:

! LaTeX Error: File `tcolorbox.sty' not found.
Type X to quit or <RETURN> to proceed ,or enter new name.
(Default extension: sty)Enter file name:! Emergency stop.<read > \usepackage

I've already downloaded the tcolorbox zip file and dragged the directory into the tex/latex tree, as said in README file, but neither that worked.

Originally I used to try to download the pdf from Jupiter Notebook, but also that gave me an error:

nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex .\notebook.tex -quiet" command:
This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/W32TeX) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
! Undefined control sequence.
<*> .\notebook
              .tex -quiet
? 
! Emergency stop.
<*> .\notebook
              .tex -quiet
No pages of output.
Transcript written on ?.

Any suggestions?



Solution 1:[1]

After installing tcolorbox using LaTex's package manager tlmgr, I was getting similar errors for other dependencies. The solution below worked for me on Ubuntu 18.04 (64 bit) at the terminal:

tlmgr update --all --self
tlmgr install tcolorbox
tlmgr install pgf
tlmgr install xcolor
tlmgr install environ
tlmgr install trimspaces
tlmgr install mathpazo
tlmgr install parskip
tlmgr install adjustbox
tlmgr install collectbox
tlmgr install eurosym
tlmgr install ecs
tlmgr install ucs
tlmgr install enumitem
tlmgr install ulem
tlmgr install mathrsfs
tlmgr install jknapltx rsfs
sudo tlmgr install collection-fontsrecommended

Also, rendering the document to PDF using the "export notebook as" option didn't work for me. I did it at the command line: jupyter nbconvert --to pdf my_document.ipynb. You may need to install nbconvert if you don't have it.

If missing other dependencies, keep running tlmgr install with the missing dependencies until it works. I haven't figured out yet to which packages those dependencies belong, so my apologies for the dirty fix.

Solution 2:[2]

In addition to Oscar's answer, I also had to run:

sudo tlmgr install collection-fontsrecommended

and it worked

Solution 3:[3]

Arch/Manjaro users, get the tllocalmgr and follow Oscar's answer

    yay -S tllocalmgr-git
    tllocalmgr update --all --self
    tllocalmgr install <package_name>
    sudo texhash

Solution 4:[4]

I ran into this same issue on Fedora

running

dnf install texlive-collection-latexextra

Seemed solved the issue for me. I found this guide How to fully install Latex in fedora? to be particularly helpful in debugging my issues. It gave all the commands needed to install the latex packages I needed

Solution 5:[5]

Similar error on mac os. In my case, it was related to required packages not being installed in tlmgr.

I had to run

sudo tlmgr install tcolorbox

After fixing that, the same error appeared with other packages (e.g. environ). I kept installing each missing package

sudo tlmgr install {name_of_missing_package}

until it succeeded.

Solution 6:[6]

Following tsando's advice on this stack overflow post, I just had to add this to my ~/.zshrc file after installing MacTex,

# TeX
export PATH=/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin:$PATH

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Shwabster
Solution 3 Praveen
Solution 4 progressEdd
Solution 5 JARS
Solution 6 EdgarHR