Plain TeX input Tikz package not found

errorsinputpackagesplain-textikz-pgf

I ran

\input tikz.tex
\bye

and the Tikz package is not found

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_2) (preloaded format=pdftex)
 restricted \write18 enabled.
entering extended mode
(./a.tex
! I can't find file `tikz.tex'.
l.1 \input tikz.tex
                   

Actually I am not able to input any TeX package in /usr/local/texlive/2021/texmf-dist/tex/plain

$ ls /usr/local/texlive/2021/texmf-dist/tex/plain
amsfonts                fixpdfmag               kotex-plain             plstmary
antt                    font-change             kurier                  present
armenian                fontch                  lambda-lists            pwebmac
asapsym                 fp                      lh                      resumemac
base                    getoptk                 ly1                     rsfs
commutative-diagrams    gfnotation              makeindex               semaphor
config                  graphics-pln            metatex                 standalone
cweb                    gustlib                 mkpattern               timetable
cweb-old                hanoi                   newsletr                treetex
cyrplain                harvmac                 omega                   tugboat-plain
encxvlna                hyplain                 pgf                     varisize
enigma                  iwona                   pgfplots                velthuis
epsf-dvipdfmx           js-misc                 pitex                   vntex
esint-type1             knitting                placeins-plain          wasy
etex                    knuth-lib               plipsum                 zztex
figflow                 knuth-local             plnfss

How can I fix this?

Just out of curiosity: which paths does TeX search for when I \input a package through plain TeX?

Best Answer

You have two tex installations one rooted at /opt/local/share/texmf-texlive and another at /usr/local/texlive/2021 you presumably have your PATH set so the tex from the first tree is being used, and the file listings that you show are from the second tree.

The second question asked in comments about \input amsfonts.tex not finding a file is expected, that directory is called amsfonts but does not have a file amsfonts.tex:

$ ls /usr/local/texlive/2021/texmf-dist/tex/plain/amsfonts/
amssym.def  amssym.tex  cyracc.def
Related Question