conda-forge / texlive-core-feedstock

A conda-smithy repository for texlive-core.
BSD 3-Clause "New" or "Revised" License
1 stars 25 forks source link

"*latex.fmt" not found #19

Open willirath opened 7 years ago

willirath commented 7 years ago

Running

latex test.tex

with latex being a symlink to pdftex in .../envs/bin/ (as introduced by #18) and test.tex being

\documentclass{article}

\begin{document}
\end{document}

I get:

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=latex)
 restricted \write18 enabled.

kpathsea: Running mktexfmt latex.fmt
Can't locate mktexlsr.pl in @INC (@INC contains: XXXXX/envs/py2_std/share/texlive/tlpkg XXXXX/envs/py2_std/share/texlive/texmf-dist/scripts/texlive XXXXX/envs/py2_std/lib/perl5/site_perl/5.22.2/x86_64-linux-thread-multi XXXXX/envs/py2_std/lib/perl5/site_perl/5.22.2 XXXXX/envs/py2_std/lib/perl5/5.22.2/x86_64-linux-thread-multi XXXXX/envs/py2_std/lib/perl5/5.22.2 .) at XXXXX/envs/py2_std/bin/mktexfmt line 23.
BEGIN failed--compilation aborted at XXXXX/envs/py2_std/bin/mktexfmt line 25.
I can't find the format file `latex.fmt'!

The same is true for pdflatex and xelatex. Comparing to my OS's latex installation, the *latex.fmt seem to belong to .../envs/py2_std/share/texlive/texmf-dist/web2c/.

willirath commented 7 years ago

I've added a test running this minimal example against latex and pdflatex in #20.

ocefpaf commented 7 years ago

Thanks! I'll take a look at it soon.

On Jul 14, 2017 6:58 AM, "Willi Rath" notifications@github.com wrote:

I've added a test running this minimal example against latex and pdflatex in #20 https://github.com/conda-forge/texlive-core-feedstock/pull/20.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/conda-forge/texlive-core-feedstock/issues/19#issuecomment-315342419, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6BLxcGA0QdOn865ZCMs-Am3hl-2A_Eks5sN1fWgaJpZM4OYF6f .

nsoranzo commented 7 years ago

Very similar issue with pdflatex:

(__texlive-core@20170520) soranzon@n79984:~$ pdflatex myworks.tex 
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
 restricted \write18 enabled.

kpathsea: Running mktexfmt pdflatex.fmt
Can't locate mktexlsr.pl in @INC (@INC contains: /usr/users/ga002/soranzon/miniconda3/envs/__texlive-core@20170520/share/texlive/tlpkg /usr/users/ga002/soranzon/miniconda3/envs/__texlive-core@20170520/share/texlive/texmf-dist/scripts/texlive /usr/users/ga002/soranzon/miniconda3/envs/__texlive-core@20170520/lib/perl5/site_perl/5.22.2/x86_64-linux-thread-multi /usr/users/ga002/soranzon/miniconda3/envs/__texlive-core@20170520/lib/perl5/site_perl/5.22.2 /usr/users/ga002/soranzon/miniconda3/envs/__texlive-core@20170520/lib/perl5/5.22.2/x86_64-linux-thread-multi /usr/users/ga002/soranzon/miniconda3/envs/__texlive-core@20170520/lib/perl5/5.22.2 .) at /usr/users/ga002/soranzon/miniconda3/envs/__texlive-core@20170520/bin/mktexfmt line 23.
BEGIN failed--compilation aborted at /usr/users/ga002/soranzon/miniconda3/envs/__texlive-core@20170520/bin/mktexfmt line 25.
I can't find the format file `pdflatex.fmt'!
Takadonet commented 7 years ago

Has anyone made any progress on this issue? These missing perl script make pdflatex un-usable.

oulenz commented 7 years ago

This means that texlive in conda is currently completely unusable, correct?

Takadonet commented 7 years ago

Correct

On Sun, Feb 11, 2018, 09:37 oulenz notifications@github.com wrote:

This means that texlive in conda is currently completely unusable, correct?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/conda-forge/texlive-core-feedstock/issues/19#issuecomment-364760571, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD83FYEy9MPVhcP9Y-Tvefcolm-_uOQks5tTwlHgaJpZM4OYF6f .

bgruening commented 7 years ago

@ocefpaf have you worked on this already?

ocefpaf commented 7 years ago

Not really. I've switched to tectonic and I don't have time to maintain texlive :-(

peterjc commented 6 years ago

I just ran into this too, it means the conda-forge texlive-core is no use to me currently 😢

Sadly tectonic is not a drop in replacement for my use-case, as I need pdflatex installed: tectonic-typesetting/tectonic#158 (comment)

If I ever had to compile LaTeX it was a very long time ago... Is it likely that all that is missing is tweaking the recipe.sh to put the missing perl scripts into $PREFIX/bin/?

percyfal commented 6 years ago

I might be wrong, but I think the issue may be related to this thread: https://www.tug.org/pipermail/tex-live/2015-May/036855.html in which one of the main texlive developers states

Irrelevant. Nobody ever said that the texlive-20150521-source is enough to get a running/working system.

You need the Master/texmf-dist tree, also in svn.

There you find Master/texmf-dist/scripts/texlive/mktexlsr.pl

I repeat: Taking the source.tar.gz, compiling, and using the inst directory will NOT give you a working TeX system. The source tar is only used for building the binaries tobedropped into Master/bin//

If correct, I guess it would require building from an svn checkout (some ~17GB!).

CJ-Wright commented 6 years ago

I ran into this as well.

morenomn commented 4 years ago

I confirm this issue still exists

h3jia commented 4 years ago

still getting the same issue...

tedwards-flf commented 3 years ago

I've recently been upgrading from Python 2 to 3, along with all the other required packages we're using at work.

Here's my minimal python example:

import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.plot([1,2,3])
plt.show()

which leads to the error mentioned above:

Can't locate mktexlsr.pl in @INC ...

I'm using Python 3.9, matplotlib 3.4.2, texlive-core 20180414

Before installing texlive-core, I had a different error message:

! LaTeX Error: File `type1ec.sty` not found

Does anyone know of a workaround for this, which still allows me to plot with latex rendered labels and serif fonts?

lecorguille commented 3 years ago

Hi, I have the same issue. Is there an alternative or is anyone try a previous version of the package ?

to-a-first-approximation commented 3 years ago

Also experiencing this issue. Any patch?

ngam commented 3 years ago

We have just updated the pkg to the 2021 version. Could you please test and report back?

@to-a-first-approximation @lecorguille @HerculesJack @tedwards-flf

ngam commented 3 years ago

Ok I can reproduce this error. We will to fix

jgunstone commented 3 years ago

i'm having the same issue

GabrielFernandezFernandez commented 3 years ago

Hi, I reproduced the same bug in my use case using JupyterLab in a server without root privileges and did some tracing. I hope it is useful to point out which are the missing pieces. I'm very glad to help because I would love to use Tex in my plots. I proceed with the steps I've done.

I do a fresh install of TeXLive using Mamba, without any previous Tex installation.

mamba install texlive-core

After installation, I try to plot in JupyterLab with Tex enabled and the error points towards this command:

mktexfmt latex

Can't locate mktexlsr.pl in @INC (@INC contains: /home/username/mambaforge/share/tlpkg /home/username/mambaforge/share/texmf-dist/scripts/texlive /home/username/mambaforge/lib/perl5/5.32/site_perl /home/username/mambaforge/lib/perl5/site_perl /home/username/mambaforge/lib/perl5/5.32/vendor_perl /home/username/mambaforge/lib/perl5/vendor_perl /home/username/mambaforge/lib/perl5/5.32/core_perl /home/username/mambaforge/lib/perl5/core_perl .) at /home/username/mambaforge/bin/mktexfmt line 23.
BEGIN failed--compilation aborted at /home/username/mambaforge/bin/mktexfmt line 25.

This mktexfmt is a symlink to the perl script at /home/username/mambaforge/share/texmf-dist/scripts/texlive/fmtutil.pl

This 23rd line is

require "mktexlsr.pl";

I found no perl script named "mktexlsr.pl" in the system but a bash script "mktexlsr" at /home/username/mambaforge/share/texmf-dist/scripts/texlive/mktexlsr

Then, I checked the variable in line 13

kpsewhich -var-value=TEXMFROOT

/home/username/mambaforge/share

So, it is looking at the correct place. Next, I tried 3 things: First, change the require statement to

require "mktexlsr";

This resulted in founding the file but then it is read as a perl script which fails because it is a bash shell script. The same happened with the second try, instead of changing the name in the require statement, I changed the file name to meet the require.

The third approach was to put a mktexlsr.pl that I found here https://github.com/norbusan/texlive-rewrite/blob/master/mktexlsr.pl from a rewriting from shell to perl.

This solved the first problem but another one prompted:

mktexfmt latex.fmt

Can't locate TeXLive/TLUtils.pm in @INC (you may need to install the TeXLive::TLUtils module) (@INC contains: /home/username/mambaforge/share/tlpkg /home/username/mambaforge/share/texmf-dist/scripts/texlive /home/username/mambaforge/lib/perl5/5.32/site_perl /home/username/mambaforge/lib/perl5/site_perl /home/username/mambaforge/lib/perl5/5.32/vendor_perl /home/username/mambaforge/lib/perl5/vendor_perl /home/username/mambaforge/lib/perl5/5.32/core_perl /home/username/mambaforge/lib/perl5/core_perl .) at /home/username/mambaforge/bin/mktexfmt line 46.
BEGIN failed--compilation aborted at /home/username/mambaforge/bin/mktexfmt line 46.

Now, it cannot find TeXLive because it was not installed. So, very badly and directly I copy TeXLive from this mirror https://github.com/TeX-Live/installer/tree/master/tlpkg/TeXLive into /home/username/mambaforge/share/texmf-dist/scripts/texlive/

It then works, but no format is generated:

mktexfmt latex.fmt

mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes:
mktexfmt:   /home/username/.texlive2021/texmf-config/web2c/fmtutil.cnf
mktexfmt [INFO]: writing formats under /home/username/.texlive2021/texmf-var/web2c
mktexfmt [INFO]: Did not find entry for byfmt=latex skipped
mktexfmt [INFO]: total formats: 0
mktexfmt [INFO]: exiting with status 0

And, I stopped here because it was draining a lot of time. As said, I hope it brings some light or intuition on what is missing. I think @percyfal hitted the bush and I just encourage whoever knows how to fix this to bring joy to the community. Thank you.

P.S: I also tried tectonic but it does not work on matplotlib plots neither on JupyterLab preview with jupyterlab_latex extension.

eschen42 commented 3 years ago

updated comment: To work around this issue, I am using r-tinytex, which handles the installation, in a "disposable" environment, (i.e., a Galaxy tool).

See comment for issue 61: https://github.com/conda-forge/texlive-core-feedstock/issues/61#issuecomment-1067316522

stanleyjs commented 2 years ago

Same issue here.

klprint commented 2 years ago

I now encountered the same issue

mrmrwinter commented 2 years ago

Also having this issue when trying to use MCScan in JCVI

RealYHD commented 2 years ago

Having this issue as well.

aersoares81 commented 2 years ago

Same here with JCVI

Dahoas commented 2 years ago

Same issue here.

Adamtaranto commented 2 years ago

Anyone found a fix for this?

Adamtaranto commented 2 years ago

I'm running into this issue using JCVI in a conda env.

I've found the same issue arising from the texlive-core package as described by @GabrielFernandezFernandez That is that mktexfmt fails to locate mktexlsr.pl on the @INC path. In my case I also tried installing MacTex and was able to find the missing script in its files and add it to the @INC path for perl like so:

export PERL5LIB=/usr/local/texlive/2022/texmf-dist/scripts/texlive/

This lead be to the same issue with not being able to locate TeXLive/TLUtils.pm.

It seems like this is definitely an issue with texlive-core installed via conda.

For anyone following this issue I tried tectonic and it also did not work.

Adamtaranto commented 2 years ago

Trying again without having to install MacTex. Manually placing a copy of mktexlsr.pl in the same location as the mktexfmt symlink target fmtutil.pl here: /opt/anaconda3/envs/myEnv/share/texmf-dist/scripts/texlive/mktexlsr.pl

Gets me to the missing module error with TeXLive/TLUtils.pm

@ngam does this version of texlive provide a means to install modules? or do I need tlmgr from MacTex?

Could I manually put the module file somewhere for texlive to discover it?

ngam commented 2 years ago

I don't think you can install modules from here, but you can try and let us know. I am happy to help in adding these files (e.g., if you want to submit a PR or I can do it later), though we may want a more systematic solution at some point.

Could I manually put the module file somewhere for texlive to discover it?

Did you try copying? You should be able to write to the conda env directory (e.g., /opt/anaconda3/envs/myEnv/share/texmf-dist/scripts/texlive/mktexlsr.pl)

Adamtaranto commented 2 years ago

Yes I copied mktexlsr.pl into opt/anaconda3/envs/myEnv/share/texmf-dist/scripts/texlive/

I don't know where modules like TeXLive/TLUtils.pm are supposed to go, or if I can just copy in the one file. I don't know what else the installer does. Any ideas?

Adamtaranto commented 2 years ago

Ok so it seems like we need two main things that are present in MacTex but not in texlive-core.

1) mktexlsr.pl needs to be in /opt/anaconda3/envs/myEnv/share/texmf-dist/scripts/texlive/, and

2) A bunch of scripts from the tlpkg/TeXLive directory (including TLUtils.pm) in MacTex need to be somewhere discoverable to perl.

I copied the whole thing to /opt/anaconda3/envs/myEnv/share/tlpkg/TeXLive/

This directory includes:

TLConfFile.pm TLConfig.pm TLCrypto.pm TLDownload.pm TLPDB.pm TLPOBJ.pm TLPSRC.pm TLPaper.pm TLTREE.pm TLUtils.pm TLWinGoo.pm TeXCatalogue.pm trans.pl

Edit: If these locations are not on your \@INC path you may need to add them i.e. export PERL5LIB=/opt/anaconda3/envs/myEnv/share/tlpkg

That seems to address the main issues and allows fmtutil.pl to run. @ngam: I think these can probably just be dropped into texlive-core.

Adamtaranto commented 2 years ago

I am still getting an error with pdflatex (which calls mktexfmt --> fmtutil.pl) not being able to locate fmtutil.cnf which exists @ /opt/anaconda3/envs/myenv/share/texmf-dist/web2c/fmtutil.cnf/web2c/fmtutil.cnf because the default paths that fmtutil searches don't seem to be set.

If you run fmtutil --help you can see the locations it searches:

Thus, if fmtutil.cnf files are present in all trees, and the default
  layout is used as shipped with TeX Live, the following files are
  read, in the given order.

  For fmtutil-sys:
  TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/fmtutil.cnf
  TEXMFSYSVAR    $TEXLIVE/YYYY/texmf-var/web2c/fmtutil.cnf
  TEXMFLOCAL     $TEXLIVE/texmf-local/web2c/fmtutil.cnf
  TEXMFDIST      $TEXLIVE/YYYY/texmf-dist/web2c/fmtutil.cnf

  For fmtutil-user:
  TEXMFCONFIG    $HOME/.texliveYYYY/texmf-config/web2c/fmtutil.cnf
  TEXMFVAR       $HOME/.texliveYYYY/texmf-var/web2c/fmtutil.cnf
  TEXMFHOME      $HOME/texmf/web2c/fmtutil.cnf
  TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/fmtutil.cnf
  TEXMFSYSVAR    $TEXLIVE/YYYY/texmf-var/web2c/fmtutil.cnf
  TEXMFLOCAL     $TEXLIVE/texmf-local/web2c/fmtutil.cnf
  TEXMFDIST      $TEXLIVE/YYYY/texmf-dist/web2c/fmtutil.cnf

  (where YYYY is the TeX Live release version).

MacTex uses this format: /usr/local/texlive/2022/texmf-var/web2c

The conda package does not install on a path following this format: /opt/anaconda3/envs/myEnv/share/texmf-dist/web2c

@ngam - Does the conda recipe set these paths somewhere?

ngam commented 2 years ago

Ah, interesting. Thanks a lot for debugging.

Does the conda recipe set these paths somewhere?

I don't think so, but we could incorporate this if needed but setting $TEXLIVE/YYYY to $CONDA_PREFIX/share

ngam commented 2 years ago

Would you be interested in attempting a PR? I will help you through it. Otherwise, I can try to add all these step by step in the near future.

I copied the whole thing to /opt/anaconda3/envs/myEnv/share/tlpkg/TeXLive/

Btw, could you provide a specific list of the "whole thing" or location so that we could add it to this recipe once confirmed?

Adamtaranto commented 2 years ago

By the whole thing I just meant the tlpkg directory that was in the top level of the MacTex installer. It contains the TeXLive dir and all the files I listed above.

I don't think my knowledge of perl or conda recipes is good enough to make a stable PR on this one if it requires modifying the texlive code. I am happy to help where I can and do tests.

ngam commented 2 years ago

Thanks, so this folder: https://github.com/TeX-Live/installer/tree/master/tlpkg

ngam commented 2 years ago

I don't think my knowledge of perl or conda recipes is good enough to make a stable PR on this one if it requires modifying the texlive code. I am happy to help where I can and do tests.

The knowledge is not a problem --- conda-forge is relatively welcoming to all! If you can contribute, please don't hesitate. You've been persistent and insightful, which's great! Also, this will be a good chance to practice. If you can get the above to work for you locally by simply copying the files, we can do the same in the recipe and see how it works

Adamtaranto commented 2 years ago

I'll try replicating the fix in a clean Docker container with Mac OSX to be sure that weird path issues aren't specific to my machine. If it is a general issue I'll need your help to fix the paths in the recipe / maybe edit relevant texlive scripts.

ngam commented 2 years ago

Okay, so here’s a plan:

ngam commented 2 years ago

@Adamtaranto I couldn't reproduce what you're describing. Could you summarize what worked for you again?

Adamtaranto commented 2 years ago

These are the files that need to be dropped into texlive:

  1. mktexlsr.pl needs to be in /opt/anaconda3/envs/myEnv/share/texmf-dist/scripts/texlive/, and
  2. A bunch of scripts from the tlpkg/TeXLive directory (including TLUtils.pm) in MacTex need to be somewhere discoverable to perl.

I copied the whole thing to /opt/anaconda3/envs/myEnv/share/tlpkg/TeXLive/

This directory includes:

TLConfFile.pm TLConfig.pm TLCrypto.pm TLDownload.pm TLPDB.pm TLPOBJ.pm TLPSRC.pm TLPaper.pm TLTREE.pm TLUtils.pm TLWinGoo.pm TeXCatalogue.pm trans.pl

Adamtaranto commented 2 years ago

I've been digging into this path issue, I think it has something to do with texlive's path-finding library Kpathsea picking up a mysterious enviroment variable from my now deleted default latex that ships with Mac OS.

I think we should ignore this for now as in is probably a separate issue specific to my case. Let's just try to get these missing dependencies working for texlive-core in a clean linux env.

For future travellers encountering problems with fmtutils paths, you can check when it is looking for tex files with these commands:

kpsewhich --var-value=TEXMFDIST
kpsewhich -var-value=TEXMFVAR
kpsewhich -var-value=TEXMFSYSVAR
kpsewhich -var-value=TEXMFCONFIG
kpsewhich -var-value=TEXMFSYSCONFIG
kpsewhich -var-value=TEXMFHOME
jinghuazhao commented 1 year ago

I had the same problem and found there is conflict between the system texlive and that from conda, texlive-core -- after uninstallation of texlive-core the error goes away,. In our case, these notes are kept here, https://cambridge-ceu.github.io/csd3/Python/PhySo.html.

vinisalazar commented 1 year ago

Just wanted to record that I had this same problem today, couldn't get any conda distributions of Tex that would work with matplotlib (tectonics did not, although it looks really good). In the end I added the system Texlive to my environment path.

JackCai1206 commented 1 month ago

Any workarounds for this issue?

Adamtaranto commented 1 month ago

texlive core is missing a bunch of essential files to work with matplotlib. Don't use it.