Registry / devops / pyx
library0.17pypypi✓ verified 87d ago

PyX is a Python package for the creation of PostScript, PDF, and SVG files, offering a high-level interface for drawing graphics, typesetting text, and generating vector graphics. Current version is 0.17, with an irregular release cadence; requires Python >=3.6.

pip install pyx
INSTALL
IMPORT
SIG · PYX
P
pyx
devopspythonv0.17
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

canvas
✓ from pyx import canvas
Common import for creating canvases.
path
✓ from pyx import path
Common import for path operations.
color
✓ from pyx import color
Common import for color handling.
deco
✓ from pyx import deco
✗ from pyx import decorations
Decorations module is 'deco' not 'decorations'.
trafo
✓ from pyx import trafo
✗ from pyx import transform
Transformation module is 'trafo' not 'transform'.

Basic example: draw a blue line and write to PDF.

from pyx import canvas, path, color c = canvas.canvas() c.stroke(path.line(0, 0, 2, 0), [color.rgb.blue]) c.writePDFfile('output') print('PDF generated')
Debug
Known issues
gotchaPyX version 0.17 is a stub release; the API may have subtle differences from earlier versions. Always refer to the official documentation for your installed version.
fix
Check docs at https://pyx-project.org/ (though may be outdated).
affects: 0.17
gotchaThe 'canvas.writePDFfile' method writes to a file, but the extension is automatically appended; do not include '.pdf' in the filename argument.
fix
Use c.writePDFfile('output') not c.writePDFfile('output.pdf').
affects: all
deprecatedThe modules 'epsfile' and 'pdfreader' are deprecated and may be removed in future versions.
fix
Use alternative approaches or contribute updates.
affects: >0.15
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyx'
PyX is not installed or installed in a different Python environment.
fix
Run 'pip install pyx' and ensure you are using the same Python interpreter.
ImportError: cannot import name 'canvas' from 'pyx'
Incorrect import path or PyX version mismatch.
fix
Use 'from pyx import canvas'. If still failing, reinstall PyX with 'pip install --upgrade pyx'.
TypeError: writePDFfile() takes 1 positional argument but 2 were given
Passing file extension in the filename argument; writePDFfile automatically adds '.pdf'.
fix
Use c.writePDFfile('output') without '.pdf' extension.
Upgrade
Version history
0.17latest on PyPI · released Nov 2, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources

No resource links recorded.

pyx — pip install pyx · libregistry