Home > Enterprise >  How to Convert CSV to XLSX Using Python 3.5?
How to Convert CSV to XLSX Using Python 3.5?

Time:01-11

How to convert CSV to XLSX using Python 3.5? Pandas and XlsxWriter don't work with this version..

CodePudding user response:

All xlsxwriter versions up to 3.0.3 support Python 3.5.

Install for Python 3.5 example :

sudo -H python3 -m pip install --index-url https://test.pypi.org/simple XlsxWriter==3.0.3

CodePudding user response:

In addition to the hint from @Alex_Borovskii on specifying the xlsxwriter version that you require I also wanted to point out that pip will/should figure out the latest version it is compatible with.

For example pip with Python 3.5 chooses xlsxwriter==3.0.3 even though there are newer (incompatible) versions available:

$ /test/Python-3.5.0/bin/pip install xlsxwriter
DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. 
Please upgrade your Python as Python 3.5 is no longer maintained. 
pip 21.0 will drop support for Python 3.5 in January 2021. 
pip 21.0 will remove support for this functionality.

Collecting xlsxwriter
  Downloading XlsxWriter-3.0.3-py3-none-any.whl (149 kB)
     |████████████████████████████████| 149 kB 11.1 MB/s
Installing collected packages: xlsxwriter
Successfully installed xlsxwriter-3.0.3

This should work back to Python 2.7 (and probably earlier). I structured/tested this when I started dropping support in XlsxWriter for deprecated Python versions.

  • Related