Installation
This is a typical Python library and is installed using pip
pip install xhtml2pdf
Requirements
Python 3.6+
All additional requirements are listed in setup.py
file and are
installed automatically using the pip install xhtml2pdf
method.
Development environment
If you don’t have it, install
pip
, the python package installersudo easy_install pip
For more information about
pip
refer to http://www.pip-installer.org/.We recommend using
virtualenv
for development. It is great to have a separate environment for each project, keeping the dependencies for multiple projects separatedsudo pip install virtualenv
For more information about
virtualenv
refer to http://www.virtualenv.org/Create a virtualenv for the project. This can be inside the project directory, but cannot be under version control
virtualenv --distribute xhtml2pdfenv --python=python2
Activate your virtualenv
source xhtml2pdfenv/bin/activate
Later to deactivate use
deactivate
Next step will be to install/upgrade dependencies from the
requirements.txt
filepip install -r requirements.txt
Run tests to check your configuration
python -m unittest discover tests
You should have a log with success status:
Ran 108 tests in 1.372s OK