우분투 (Django)에 Pisa 설치
-
21-12-2019 - |
문제
PISA를 설치하려고 시도하고 있으며 모든 요구 사항이 설치되었습니다.
가져 오기 시도 :
import ho.pisa as pisa
.
또는 :
import xhtml2pd.pisa as pisa
.
오류 :
ImportError
Exception Value:
No module named reportlab.lib.units
.
마지막 추적 :
from pisa_util import *
from reportlab.lib.units import inch, cm
.
가상 환경에서 실행 중입니다.모든 요구 사항이 설치되어 있습니다.
Did :
sudo apt-get install python-pisa
.
test.html 생성 및 명령 줄 :
xhtml2pdf test.html target.pdf
.
PDF를 올바르게 생성
그러나 :
pip install reportlab
Requirement already satisfied (use --upgrade to upgrade): reportlab in /usr/local/lib/python2.7/dist-packages
Cleaning up...
.
계속 던지기 오류가 발생했습니다.
도움이 감사합니다.
해결책
이 문제가 해결책으로 적절한 섹션으로 이동했습니다.
의문의 저자에게 : 평판을 얻으려면 새로운 답변을 작성 하고이 답변을 제거하도록 저를 핑 해주세요.
마침내 문제가 해결되었습니다.
가상 환경에있는 경우 다음을 수행해야합니다.
pip install reportlab
.
bin
폴더의 project
디렉토리, i.e :
~/.virtualenvs/project/bin
. 다른 팁
PIP 설치 xhtml2pdf
PIP 설치 PISA
제휴하지 않습니다 StackOverflow