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

This article was translated from English: Does it need improvement?
Translated
View the article in English

다음 명령어를 사용하여 pip를 통해 .NET 6.0 SDK와 IronPdf를 설치했다고 가정합니다.

 pip install ironpdf

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

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

해결책

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')
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")
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 설치 디렉터리 내에 있거나 가상 환경을 사용하는 경우 가상 환경 디렉터리 내에 있습니다. 이 디렉토리는 파이썬 인터프리터에서 접근할 수 있는 디렉토리입니다.

IronPDF는 IronPdf.SlimIronPdf.Native.Chrome.Windows를 모두 설치합니다.

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

커티스 차우
기술 문서 작성자

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

커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다.

시작할 준비 되셨나요?
버전: 2026.2 방금 출시되었습니다