오류: Python에서 IronPDF 찾지 못했습니다.

Curtis Chau
Curtis Chau
업데이트됨:

.NET 6.0 SDK 및 IronPDF를 다음 명령을 사용하여 pip을 통해 설치한 것으로 가정합니다:

> pip install ironpdf

Python 스크립트를 실행하는 동안 아래와 같은 예외가 발생할 수 있습니다.

Exception has occurred: Exception
Failed to locate IronPdf.Slim.dll at 'C:\Users\Name\AppData\Local\Programs\Python\Python311/IronPdf.Slim'. Please see /troubleshooting/quick-ironpdf-troubleshooting/ for more information
  File "C:\Users\Name\OneDrive\Documents\IronPdfPythonNew\working\viewport.py", line 1, in <module>
    from ironpdf import *
Exception: Failed to locate IronPdf.Slim.dll at 'C:\Users\Name\AppData\Local\Programs\Python\Python311/IronPdf.Slim'. Please see https://ironpdf.com/troubleshooting/quick-ironpdf-troubleshooting/ for more information
Text

해결책

다음과 같이 IronPdf.Slim가 포함된 디렉터리를 지정할 수 있습니다:

import sys
# Set the path to include the directory containing the IronPdf.Slim files.
# Users can determine this location by running `pip uninstall ironpdf` and pressing `N` to view the installation path.
sys.path.append('/path/to/python/packages')
Python

예를 들어

import sys
# Add the directory of the IronPdf installation to the path for module resolution.
# This should point to the root directory of where IronPdf is installed.
sys.path.append(r'C:\Users\lyty1\AppData\Local\Programs\Python\Python311\Lib\site-packages')

from ironpdf import *

# Instantiate Renderer
renderer = ChromePdfRenderer()

# Create a PDF from a URL or local file path
pdf = renderer.RenderUrlAsPdf("https://ironpdf.com/")

# Export to a file or Stream
pdf.SaveAs("url.pdf")
Python

이유

대부분의 타사 라이브러리는 "site-packages"라는 디렉터리에 설치되며, 이 디렉터리는 Python 설치 디렉터리 내에 있거나 가상 환경을 사용하는 경우 가상 환경 디렉터리 내에 있습니다. 이 디렉토리는 Python 인터프리터에서 접근할 수 있는 디렉토리입니다.

IronPDF는 IronPdf.Slim 및 IronPdf.Native.Chrome.Windows 둘 다 설치할 것입니다.

정확한 위치는 운영 체제 및 Python 구성에 따라 다를 수 있습니다.

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

더 읽기

시작할 준비 되셨나요?

버전:2026.11방금 출시