Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Install two separate components: the Python package pdfkit and the native Windows wkhtmltopdf.exe renderer. pip install pdfkit installs only the Python wrapper; it does not install wkhtmltopdf itself. Download the Windows installer for wkhtmltopdf separately, put its bin directory on PATH (or configure the full path in Python), then verify the executable before calling pdfkit.
What you are actually installing
pdfkit is a Python wrapper around the wkhtmltopdf command-line utility. wkhtmltopdf converts HTML into PDF with its Qt WebKit rendering engine; pdfkit starts that executable and passes it options. They are distributed independently.
| Component | How it is installed | What it provides |
|---|---|---|
pdfkit |
py -m pip install pdfkit |
Python API such as pdfkit.from_url() and pdfkit.from_string() |
| wkhtmltopdf | Separate Windows installer from the project’s download page | The native wkhtmltopdf.exe renderer |
If pdfkit reports that no wkhtmltopdf executable was found, the Python package may be installed correctly; Windows simply cannot discover the native binary.
Recommended Free Tools
Prerequisites and Windows checks
- A supported Windows installation and permission to install software.
- Python installed from the current Windows installer or Python Install Manager. Python’s Windows documentation states that the manager is available from python.org or the Microsoft Store and exposes
python,pyandpymanagercommands. - A new Command Prompt or PowerShell window after each installer changes
PATH.
Open a fresh terminal and check Python first:
py --version
python --version
Use whichever command works consistently. The examples below use py, the documented Windows form for invoking Python and pip.
#1 Best Overall
- 14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
Step 1: Install the Python wrapper
- Open PowerShell or Command Prompt.
- Run:
py -m pip install pdfkit
Using py -m pip ties pip to the Python launcher you selected, avoiding a common situation where pip belongs to a different Python installation. To update the wrapper later, run py -m pip install --upgrade pdfkit.
Confirm that Python can import it:
py -c "import pdfkit; print(pdfkit.__file__)"
A printed file path confirms the wrapper is installed. It does not yet prove that wkhtmltopdf is available.
Step 2: Install the native wkhtmltopdf renderer
- Open the wkhtmltopdf project’s official download page.
- Choose the Windows installer appropriate to your system and download it.
- Run the installer. Note the destination folder, especially the directory containing
wkhtmltopdf.exe, commonly abinsubfolder. - Allow the installer to finish, then close every existing terminal window.
The pdfkit installation guidance directs Windows users to install the binary separately and add its folder to PATH. The retrieved project material does not establish a current release number or a tested Windows-version compatibility matrix, so check the download page’s current notes for your edition of Windows rather than relying on an old version claim.
Rank #2
- 1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core
- 4GB DDR4 System Memory; 128GB Solid State Drive
- 11.6" HD (1366 x 768) Multi-Touch Display
- Combo headphone/microphone jack - Noble Wedge Lock slot - HDMI; 2 USB 3.1 Gen 1
- Windows 11 Pro
Step 3: Put wkhtmltopdf on PATH
Adding the directory that contains the executable lets every process locate it by name.
- Press Win, search for Environment Variables, and open Edit the system environment variables.
- Select Environment Variables….
- Under User variables (normally sufficient for your account), select Path and choose Edit.
- Choose New and enter the folder containing
wkhtmltopdf.exe, not the parent installer directory. - Confirm every dialog with OK.
- Open a new terminal so it receives the updated environment.
You can also set a user-level path from PowerShell, replacing the example with your actual directory:
$old = [Environment]::GetEnvironmentVariable('Path','User')
$new = "$old;C:Program Fileswkhtmltopdfbin"
[Environment]::SetEnvironmentVariable('Path',$new,'User')
Avoid adding the same directory repeatedly; duplicate entries make later troubleshooting harder.
Rank #3
- 256 GB SSD of storage.
- Multitasking is easy with 16GB of RAM
- Equipped with a blazing fast Core i5 2.00 GHz processor.
Step 4: Verify executable discovery
Run both commands in a newly opened shell:
where wkhtmltopdf
wkhtmltopdf --version
where should print the full path to the executable. The version command should print wkhtmltopdf’s installed version and then return to the prompt. These checks separate a missing native installation or PATH problem from a Python packaging problem.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
If where returns “INFO: Could not find files,” locate wkhtmltopdf.exe in File Explorer, add its containing folder to PATH, and reopen the terminal. If the file is absent, rerun the Windows installer rather than trying another pip command.
Step 5: Create and run a minimal Python conversion
Save this as test_pdfkit.py in a writable folder:
import pdfkit
html = """
pdfkit test
Hello
wkhtmltopdf is working.
"""
pdfkit.from_string(html, "hello.pdf")
print("Created hello.pdf")
Run it with:
py test_pdfkit.py
A successful run creates hello.pdf beside the script. pdfkit normally searches for the executable with Windows where, so a working PATH is enough for this basic case.
Rank #4
- EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
- 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
- RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
- ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
- LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.
Step 6: Configure an explicit executable path
Use explicit configuration when you cannot change PATH, have multiple installations, run from a service, or need deterministic behavior across machines.
import pdfkit
config = pdfkit.configuration(
wkhtmltopdf=r'C:Program Fileswkhtmltopdfbinwkhtmltopdf.exe'
)
pdfkit.from_string(
'<h1>Hello</h1>',
'hello.pdf',
configuration=config
)
The raw string prefix (r) prevents backslashes in a Windows path from being interpreted as escape sequences. Confirm that the path points to the file itself and not merely to its containing directory. If wkhtmltopdf was installed elsewhere, substitute that exact path.
Useful pdfkit entry points and options
Convert a web address
import pdfkit
pdfkit.from_url('https://example.com', 'example.pdf')
Convert a local HTML file
import pdfkit
pdfkit.from_file('report.html', 'report.pdf')
Pass wkhtmltopdf options
import pdfkit
options = {
'page-size': 'A4',
'margin-top': '15mm',
'margin-right': '15mm',
'margin-bottom': '15mm',
'margin-left': '15mm',
'encoding': 'UTF-8',
'quiet': ''
}
pdfkit.from_string('Report
', 'report.pdf', options=options)
Option names are wkhtmltopdf command-line options without the leading hyphens. Rendering is performed by the installed native version, so available behavior and compatibility depend on that binary; consult its current documentation for options your version supports.
Best Value
- WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
- 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
- 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
- CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
- LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.
Troubleshooting: error, cause and fix
| Symptom | Likely cause | Fix |
|---|---|---|
OSError: No wkhtmltopdf executable found |
The binary is not installed or is not on PATH. | Run where wkhtmltopdf. Install the Windows renderer, add its bin folder to PATH, open a new shell, or pass pdfkit.configuration(wkhtmltopdf=...). |
where finds nothing, but you installed it |
The terminal was opened before PATH changed, or the wrong folder was added. | Open a new terminal and ensure PATH contains the folder that directly contains wkhtmltopdf.exe. |
py -m pip install pdfkit fails |
Python or the launcher is unavailable, pip is missing, or network/package permissions block installation. | Check py --version; repair Python or install it from the current official Windows distribution, then retry. Do not expect this command to install the native renderer. |
ImportError for pdfkit |
The package was installed into a different Python interpreter or virtual environment. | Install and run with the same interpreter: py -m pip install pdfkit, then py -c "import pdfkit". |
| PDF is blank or missing images | The source page depends on resources that the renderer cannot load, or the HTML uses paths that are invalid from the conversion process. | Test with a self-contained HTML file, verify image URLs and encoding, and inspect the native renderer’s output. A successful executable lookup does not guarantee that every modern web page renders correctly. |
| Works in a terminal but fails in a scheduled task or service | That process has a different PATH, account or permissions. | Use the absolute executable path in pdfkit.configuration and ensure the service account can read the HTML, assets and output directory. |
| Access or write errors | The destination directory is protected or the input file is locked. | Write to a user-owned test directory and verify permissions before moving the job to a service location. |
Reliability and maintenance practices
- Pin the
pdfkitversion in a requirements file when reproducible deployments matter, but still install wkhtmltopdf separately on each Windows host. - Record the output of
wkhtmltopdf --versionwith your deployment information. The wrapper and renderer have separate version lifecycles. - Use an explicit executable path in production services when PATH can differ between interactive users and service accounts.
- Test fonts, CSS, images, JavaScript timing and page breaks with representative documents; a minimal “Hello” conversion tests discovery, not visual fidelity.
- Keep input and output paths absolute while diagnosing failures, then add timeouts and job-level logging around your own application code.
Or skip the browser setup
If your real goal is to capture a clean image or PDF of a public web page rather than maintain a Windows renderer, ScreenshotNeo provides a one-request alternative. It accepts cookie and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. It also offers an MCP server for Claude, Cursor and other MCP clients, with take_screenshot, get_page_info and capture_pdf tools.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo documentation for request options. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo to try the free allowance.
Choosing between local wkhtmltopdf and an API
| Need | Better fit |
|---|---|
| Offline conversion, local files or control of a Windows executable | pdfkit plus a separately installed wkhtmltopdf binary |
| Automated public-page captures without managing browser dependencies | ScreenshotNeo API |
| AI-agent screenshot workflows | ScreenshotNeo MCP server |
| Strictly identical output across machines | Pin your Python dependency and record a specific native renderer installation, then test the document set |
FAQ
Is wkhtmltopdf installed with pip?
No. pip installs the pdfkit Python wrapper. wkhtmltopdf is a separate native Windows installer.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Do I need both PATH and an explicit configuration?
No. PATH is convenient for interactive use; an explicit absolute path is often safer for services and multiple installations.
How can I tell whether the problem is Python or wkhtmltopdf?
Run py -c "import pdfkit" for the wrapper and where wkhtmltopdf plus wkhtmltopdf --version for the native executable.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

