2/2
That error means your Python installation doesn’t have Tkinter’s C library (libtk8.6) available — it’s missing the system-level Tk and Tcl packages that provide the GUI backend.
On Arch Linux, Tkinter support isn’t bundled by default, so you need to install the correct system packages.
Run this in your terminal:
This installs both tk and its dependency tcl, which includes the libtk8.6.so shared library that Tkinter needs.
After installation, verify Tkinter works:
If a small empty GUI window appears, Tkinter is now working.
It should now start without the import error.
Would you like me to show you how to install it system-wide (so you can just run pdf_to_md from anywhere) instead of using python pdf_to_md.py each time?
Input: /home/zg/Downloads/ntsamplepaper-nat-IM.pdf Output: /home/zg/Downloads/test.md Options → CAPS→Headings=True, Defragment=True, HeadingRatio=1.15, OrphanLen=45, PageBreaks=False, RemoveHF=True, ExportImages=False, PreviewOnly=False ✖ Error: PyMuPDF (fitz) is not installed. Install with: pip install pymupdf getting this error in the app even though i installed it with pipx here is proof ○ pymupdf ⌂ 10:25 usage: pymupdf [-h] {show,clean,join,extract,embed-info,embed-add,embed-del,embed-upd,embed-extract,embed-copy,gettext,internal}... ------------------------- Basic PyMuPDF Functions ------------------------- options: -h, --help show this help message and exit Subcommands: {show,clean,join,extract,embed-info,embed-add,embed-del,embed-upd,embed-extract,embed-copy,gettext,internal} Enter 'command -h' for subcommand specific help ◎
Good — that tells us exactly what’s going on.
The issue isn’t with PyMuPDF itself, but where it’s installed.
Let’s unpack this:
pymupdf with pipx → that means it lives in an isolated environment, not in your main Python interpreter.So the script doesn’t see it.
This is the simplest fix:
If you’re on Arch and using Python 3.13, you can verify pip matches your version:
Then rerun:
Since pdf_to_md.py isn’t itself installed as a pip package, pipx isolation doesn’t help much — it’s meant for full tools, not local scripts.
So, Option 1 is better.
If you want to keep things clean:
After installing, test PyMuPDF manually:
If it prints a short description, you’re good.
Would you like me to show how to add a simple pdf_to_md CLI wrapper so you can just run:
from anywhere, instead of python pdf_to_md.py?
i don't have pip
Got it 👍 — that’s easy to fix on Arch Linux.
Python comes preinstalled, but pip is often a separate package.
Run this:
That gives you the correct version of pip for your Python (3.13).
Check it with:
or safer:
You should see something like:
Now install the missing dependency:
You can confirm it’s installed:
It should now detect PyMuPDF (fitz) correctly and run.
Would you like me to make it so you can run the script just by typing pdf_to_md (without needing to cd into the folder)?
◄ 2s ⋈┈○ pip install pymupdf ⌂ 10:27 error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try 'pacman -S python-xyz', where xyz is the package you are trying to install. If you wish to install a non-Arch-packaged Python package, create a virtual environment using 'python -m venv path/to/venv'. Then use path/to/venv/bin/python and path/to/venv/bin/pip. If you wish to install a non-Arch packaged Python application, it may be easiest to use 'pipx install xyz', which will manage a virtual environment for you. Make sure you have python-pipx installed via pacman. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. ◄ 6s ⋈┈○
Perfect — that’s Arch Linux doing its job 👏
Arch enforces PEP 668, which protects system Python from being modified by pip.
You have three clean options to fix this — here’s the breakdown:
This keeps things clean and avoids touching system Python.
✅ Advantages
Each time you want to use it:
You can exit the venv anytime with:
If you really want to install globally:
⚠️ Warning: This modifies the Arch-managed Python install.
Only do this if you understand the risks (it can interfere with pacman-managed Python packages).
You can install pdf_to_md itself via pipx and let it handle isolation automatically:
Then you’ll be able to just run:
from anywhere on your system.
💡 Recommended for you:
Since you already cloned the repo and are testing it manually, Option 1 (virtual environment) is the cleanest, most Arch-friendly approach.
Would you like me to make a one-liner script (run_pdf_to_md.sh) that automatically activates the venv and runs the converter with your input/output paths?