PyExcel is a wrapper library that provides a unified API to read, manipulate, and write data in various Excel formats such as CSV, XLS, XLSX, and ODS. It focuses purely on data processing, enabling easy conversion of Excel data into Python arrays or dictionaries and vice versa, without supporting features like fonts, colors, or charts. The library is actively maintained, with frequent minor releases.
pip install pyexcelVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to write a Python dictionary to a multi-sheet Excel file and then read it back into a sheet object and a book dictionary. It assumes the necessary format-specific plugins (like `pyexcel-xlsx`) are installed.
Upgrade to Python 3.6 or newer. For older Python 3 versions, ensure pyexcel-io and its plugins are below v0.6.0.
Remove all `import pyexcel.ext.*` statements. Simply ensure the relevant `pyexcel-xxx` plugin library is installed (e.g., `pip install pyexcel-xlsx`).
Be aware that only raw data is preserved. If styling or advanced Excel features are critical, PyExcel is not the right tool.
Install the specific plugin for your target format (e.g., `pip install pyexcel-xlsx` for .xlsx files, `pip install pyexcel-xls` for .xls files).
Use the `library='plugin_name'` parameter in functions like `get_array`, `save_as`, etc., e.g., `pyexcel.get_sheet(file_name='my.ods', library='pyexcel-ods3')`.
Install the correct plugin for your file type. For .xlsx files: `pip install pyexcel-xlsx`. For older .xls files: `pip install pyexcel-xls`. Ensure the file is not corrupted and is a valid Excel format.
Install the `pyexcel` package using pip: `pip install pyexcel`.
Verify the file name is spelled correctly, provide the full absolute path to the file, or ensure the file is located in your script's current working directory.
Explicitly tell PyInstaller to include the necessary `pyexcel` plugins as hidden imports. For example, if you use both .xls and .xlsx: `pyinstaller --hidden-import=pyexcel_xls --hidden-import=pyexcel_xlsx your_script.py` (adjust plugins as per your needs).