Xelatex not found on path windows

So for the last almost year and a half, I have taught myself enough Python to work within the infrastructure of my company. I am trying to expand my knowledge of programming locally. I am in the pr...

I have the same issue.

/miktex/bin/x64 is in my Path, and xelatex is installed, but I’m still getting this error.

[NbConvertApp] Converting notebook C:UsersuserDocuments#work_stuffanodot summaryprediction datapayoneer - lstm prophet.ipynb to pdf
[NbConvertApp] Writing 19232 bytes to C:UsersuserDocuments#work_stuffanodot summaryprediction datanotebook.tex
[NbConvertApp] Building PDF
Traceback (most recent call last):
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvScriptsjupyter-nbconvert-script.py", line 10, in <module>
    sys.exit(main())
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesjupyter_coreapplication.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagestraitletsconfigapplication.py", line 658, in launch_instance
    app.start()
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertnbconvertapp.py", line 325, in start
    self.convert_notebooks()
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertnbconvertapp.py", line 493, in convert_notebooks
    self.convert_single_notebook(notebook_filename)
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertnbconvertapp.py", line 464, in convert_single_notebook
    output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertnbconvertapp.py", line 393, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertexportersexporter.py", line 174, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertexportersexporter.py", line 192, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertexporterspdf.py", line 175, in from_notebook_node
    rc = self.run_latex(tex_file)
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertexporterspdf.py", line 137, in run_latex
    self.latex_count, log_error)
  File "C:UsersuserAppDataLocalcondacondaenvsmyenvlibsite-packagesnbconvertexporterspdf.py", line 99, in run_command
    "at {link}.".format(formatter=command_list[0], link=link))
OSError: xelatex not found on PATH, if you have not installed xelatex you may need to do so. Find further instructions at https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex.

Whenever I try to export a Jupyter notebook as a PDF I get the following error in a separate window:

500 : Internal Server Error
The error was:

nbconvert failed: xelatex not found on PATH, if you have not installed xelatex you may need to do so. Find further instructions at https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex.

I am running macOS Sierra 10.12.6.

Things I have tried:

  • Re-installing nbconvert through pip (in the Jupyter notebook) and conda (terminal)
  • Installing xelatex for Mac
  • Re-installing Mactex
  • Installing pandoc (both through pip and through «conda install -c conda-forge pandoc»)

Running

!echo $PATH

Yields:

/Users/ed/anaconda/bin:/Users/ed/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin

I located the directory containing xelatex as per @einsweniger suggestion here: /usr/local/texlive/bin/x86_64-darwin. I copied and pasted XeLatex into the bin directory above, and get a new error:

nbconvert failed: PDF creating failed, captured latex output:
warning: kpathsea: configuration file texmf.cnf not found in these directories: /Users/e/anaconda/bin:/Users/ed/anaconda/bin/share/texmf-local/web2c:/Users/ed/anaconda/bin/share/texmf-dist/web2c:/Users/ed/anaconda/bin/share/texmf/web2c:/Users/ed/anaconda/bin/texmf-local/web2c:/Users/ed/anaconda/bin/texmf-dist/web2c:/Users/ed/anaconda/bin/texmf/web2c:/Users/ed/anaconda:/Users/edefilippis/anaconda/share/texmf-local/web2c:/Users/e/anaconda/share/texmf-dist/web2c:/Users/ed/anaconda/share/texmf/web2c:/Users/ed/anaconda/texmf-
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)

kpathsea: Running mktexfmt xelatex.fmt
I can’t find the format file `xelatex.fmt’!

I also put xelatex.fmt in the directory, but am still getting the error.

outis's user avatar

outis

74.3k21 gold badges149 silver badges219 bronze badges

asked Sep 12, 2018 at 17:04

Parseltongue's user avatar

ParseltongueParseltongue

10.8k28 gold badges90 silver badges154 bronze badges

3

I encountered the same issue. As people previously stated, the problem lies in that xlatex isn’t found in your PATH environment variable.

A solution that worked for me was to run the following from the notebook:

!export PATH=/Library/TeX/texbin:$PATH

Or in a command line simply:

export PATH=/Library/TeX/texbin:$PATH

And then run the export to pdf from a command line (within your virtual environment if there is one in place) as follows:

 jupyter nbconvert your_notebook.ipynb --to pdf

This should create a pdf of your notebook on the same directory it is running.

answered Apr 3, 2019 at 15:51

Nico's user avatar

2

I’m not accustomed with Mac install paths, from what the basictex faq says, I gather the executeables should live in /usr/local/texlive/bin/x86_64-darwin
Running which xelatex in a terminal might also help finding where the command is, but that only works if the directory is already in your PATH variable.

Another method would be running find / -name 'xelatex' if it is not within your PATH so you might find it that way (might take a while as this will search you whole harddrive).

Once you’ve found it and added the path to your PATH variable, you should also check if the jupyter has the correct PATH by running

import os
print(os.environ['PATH'])

within a notebook.

answered Sep 18, 2018 at 8:54

einsweniger's user avatar

einswenigereinsweniger

6016 silver badges15 bronze badges

4

$ sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic

Mona Jalal's user avatar

Mona Jalal

32.8k63 gold badges221 silver badges389 bronze badges

answered Nov 2, 2021 at 10:59

Danial Shabbir's user avatar

1

On mac, you can install mactex using homebrew with the following: brew install --cask mactex

answered Apr 3, 2021 at 23:30

Yaakov Bressler's user avatar

Yaakov BresslerYaakov Bressler

8,1382 gold badges40 silver badges60 bronze badges

I know this question is long answered, but I just ran into this issue and found a very easy, codeless solution: print to PDF.

Thought I might post this here for anyone else who doesn’t feel like figuring out path variables or updating a zillion different things. Your browser’s print function probably works just fine.

answered Oct 6, 2022 at 1:13

eva bacas's user avatar

I’ve run into similar issues in the past with paths in python when using tensorflow in Windows and Linux. As is pointed out by others, using PATH is the way to go (i.e update in .bashrc if it was linux), but I’ve found the code below to resolve path issues on a script by script basis.

import sys
if "yourpathtoxelatex" not in sys.path:
    print('adding path') # I just add this to know if the path was present or not.
    sys.path.append("yourpathtoxelatex")

essentially would check PATH for what it is you are looking for and then adds it if it is missing. You probably don’t even need the ‘if’ statement.
Perhaps not the most practical way has worked well for me where I know the path in question is perhaps a ‘rarely used’ or ‘one time use’ PATH add…

So as was pointed out in comments above (and I think you already have) find the location of the file and add its location using the above code.

Some more reading on it:
https://docs.python.org/3/tutorial/modules.html
6.2 Standard Modules

answered Sep 22, 2018 at 5:57

IamSierraCharlie's user avatar

If (You are using jupyter the easier way I found was to)

  • Download the file in latex.
  • Upload it to overleaf.
  • And then download it as a pdf

Else if ( You are using google collab)

  • Download as ipynb
  • Upload to jupyter and repeat the above steps.

answered Jan 29, 2022 at 7:25

Inevitable4's user avatar

Windows users can save the .ipynb file as a HTML file and print the HTML file to save it as PDF with custom settings.

answered Aug 23, 2022 at 22:48

Laksath Adityan M K's user avatar

If there is an update available maybe try and update Jupyter

answered Sep 15, 2018 at 18:52

Add "env": {"PATH":"$PATH"} to your kernel.json, for me that was in /opt/anaconda3/share/jupyter/kernels/python3/kernel.json.

JupyterLab or Anaconda seems to override the system PATH by default, if you set this then the PATH will be the same in JupyterLab and in your shell, so if you have anything custom installed like xelatex, it will show up in JupyterLab.

answered Oct 29, 2020 at 12:03

Henry Cooksley's user avatar

Run this command in your jupyter terminal (or in your environment if you have any), close all jupyter notebook tabs and reopen it then convert the notebook to pdf

pip install --upgrade --user nbconvert

answered Apr 12, 2021 at 20:19

Sidrah Madiha Siddiqui's user avatar

How to install latex and xelatex on Mac so that Jupyter «Download as PDF» will work

brew install pandoc
brew tap homebrew/cask
brew cask install basictex
eval "$(/usr/libexec/path_helper)"
# Update $PATH to include `/usr/local/texlive/2020basic/bin/x86_64-darwin`
sudo tlmgr update --self
sudo tlmgr install texliveonfly
sudo tlmgr install xelatex
sudo tlmgr install adjustbox
sudo tlmgr install tcolorbox
sudo tlmgr install collectbox
sudo tlmgr install ucs
sudo tlmgr install environ
sudo tlmgr install trimspaces
sudo tlmgr install titling
sudo tlmgr install enumitem
sudo tlmgr install rsfs

More info here

answered Jun 13, 2022 at 8:41

dembelet's user avatar

Close all the anaconda runing programs and then,open conda command prompt and try the following command:
conda install -c conda-forge pandoc

answered Dec 15, 2022 at 13:43

Vini_OP's user avatar

  1. Update/Reinstall Anaconda if not updated.
  2. now install chromium through link https://chromium.woolyss.com/download/en/ and make it default browser.
  3. Then run jupyter notebook using this browser.
  4. Lastly use option «Download as» in jupyter notebook and then select the option using PDF via pyppeteer (.html)

HOLA!! It worked..

answered Jun 17, 2021 at 18:15

Supriya's user avatar

I tried to run the command

jupyter nbconvert --to pdf xxx.ipynb

and I got the error

xelatex not found on PATH, if you have not installed xelatex you may need to do so.

Xelatex does not exist in MiKTeX package manager i tried to get the xelatex package and add it or to update MiKTeX packager manager but always it’s not working.

Thanks in advance.

  • xetex
  • miktex

MWiesner's user avatar

MWiesner

2251 silver badge11 bronze badges

asked Feb 6, 2018 at 14:34

Ameni Hileli's user avatar

Ameni HileliAmeni Hileli

311 gold badge1 silver badge2 bronze badges

2

  • This does not seem like a TeX.SX question. Check that xetex is installed in MiKTeX. You’d also need to include the location of *tex binaries into the PATH variable.

    Feb 6, 2018 at 15:36

  • I’m not sure what exactly you’ve done here: you might have a ‘bust’ MiKTeX install. Does XeTeX work from the Command Prompt (e.g. with xetex --version)?

    Feb 7, 2018 at 7:20

Whenever I try to export a Jupyter notebook as a PDF I get the following error in a separate window:

500 : Internal Server Error
The error was:

nbconvert failed: xelatex not found on PATH, if you have not installed xelatex you may need to do so. Find further instructions at https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex.

I am running macOS Sierra 10.12.6.

Things I have tried:

  • Re-installing nbconvert through pip (in the Jupyter notebook) and conda (terminal)
  • Installing xelatex for Mac
  • Re-installing Mactex
  • Installing pandoc (both through pip and through “conda install -c conda-forge pandoc”)

Running

!echo $PATH

Yields:

/Users/ed/anaconda/bin:/Users/ed/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin

I located the directory containing xelatex as per @einsweniger suggestion here: /usr/local/texlive/bin/x86_64-darwin. I copied and pasted XeLatex into the bin directory above, and get a new error:

```nbconvert failed: PDF creating failed, captured latex output:
warning: kpathsea: configuration file texmf.cnf not found in these directories: /Users/e/anaconda/bin:/Users/ed/anaconda/bin/share/texmf-local/web2c:/Users/ed/anaconda/bin/share/texmf-dist/web2c:/Users/ed/anaconda/bin/share/texmf/web2c:/Users/ed/anaconda/bin/texmf-local/web2c:/Users/ed/anaconda/bin/texmf-dist/web2c:/Users/ed/anaconda/bin/texmf/web2c:/Users/ed/anaconda:/Users/edefilippis/anaconda/share/texmf-local/web2c:/Users/e/anaconda/share/texmf-dist/web2c:/Users/ed/anaconda/share/texmf/web2c:/Users/ed/anaconda/texmf-
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)

kpathsea: Running mktexfmt xelatex.fmt
I can't find the format file `xelatex.fmt'!
```

I also put xelatex.fmt in the directory, but am still getting the error.

Answer

I encountered the same issue. As people previously stated, the problem lies in that xlatex isn’t found in your PATH environment variable.

A solution that worked for me was to run the following from the notebook:

!export PATH=/Library/TeX/texbin:$PATH

Or in a command line simply:

export PATH=/Library/TeX/texbin:$PATH

And then run the export to pdf from a command line (within your virtual environment if there is one in place) as follows:

 jupyter nbconvert your_notebook.ipynb --to pdf

This should create a pdf of your notebook on the same directory it is running.

Attribution
Source : Link , Question Author : Parseltongue , Answer Author : Nico

Понравилась статья? Поделить с друзьями:
  • Xerox 3010 driver windows 7 x64
  • Xerox p8ex драйвер windows 7 x64
  • Xd3audio1 7 dll для windows 7
  • Xerox p114e драйвер для windows xp
  • Xerox 118 драйвер windows 10 64 bit