Pregunta

estoy tratando de dar django-easy-pdf Vamos, pero tengo problemas para instalar dependencias.

yo obtengo ImportError: No module named xhtml2pdf.default al ejecutar Django.

Para intentar arreglarlo, hice un pip install xhtml2pdf, pero eso produce Could not find any downloads that satisfy the requirement pyPdf (from xhtml2pdf).

Así que hagamos un pip install --allow-unverified pyPdf pyPdf para evitar eso.Esto se completó sin problemas.Al repetir el pip install xhtml2pdf, el software se instala sin problemas.

Sin embargo, al iniciar Django 1.6, aparece: ImportError: Reportlab Version 2.1+ is needed!.

Sin embargo, tengo instalado reportlab 2.2 o superior, ya que pip freeze listas 3.0.

Parece que esto está codificado en algunos archivos (util.py y __init__.py):

if not (reportlab.Version[0] == "2" and reportlab.Version[2] >= "1"):
    raise ImportError("Reportlab Version 2.1+ is needed!")

if not REPORTLAB22:
    raise ImportError, "Reportlab Toolkit Version 2.2 or higher needed"

¿Cómo se puede solucionar esto (excepto eliminar estas comprobaciones de la fuente)?

¿Fue útil?

Solución

El autor menciona en https://github.com/nigma/django-easy-pdf :

django-easy-pdf depends on:
  django>=1.5.1
  git+https://github.com/chrisglass/xhtml2pdf.git

Es necesario instalar la versión específica, y no la que está disponible en PYPI.Primera desinstalación XHTML2PDF y PYPDF utilizando pip uninstall, luego haga:

pip install git+https://github.com/chrisglass/xhtml2pdf.git

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top