jmcnamara / XlsxWriter

A Python module for creating Excel XLSX files.
https://xlsxwriter.readthedocs.io
BSD 2-Clause "Simplified" License
3.61k stars 630 forks source link

Error in install via tarball process #183

Closed david-teasdale closed 9 years ago

david-teasdale commented 9 years ago

i used:

tar -zxvf  XlsxWriter-0.6.3.tar.gz 
cd XlsxWriter-0.6.3
sudo python setup.py install

and this is what was displayed

running install
...
copying xlsxwriter/chartsheet.py -> build/lib/xlsxwriter
running build_scripts
creating build/scripts-2.4
copying and adjusting examples/vba_extract.py -> build/scripts-2.4
changing mode of build/scripts-2.4/vba_extract.py from 644 to 755
running install_lib
byte-compiling /usr/lib/python2.4/site-packages/xlsxwriter/chart_line.py to chart_line.pyc
  File "/usr/lib/python2.4/site-packages/xlsxwriter/chart_line.py", line 8
    from . import chart
         ^
...

there are a few lines that include from . in the files ... what did i do wrong ?

jmcnamara commented 9 years ago

Hi David,

Thanks for the detailed report.

From your trace it looks like your version of Python is Python 2.4. The oldest version supported by XlsxWriter is Python 2.5 but I would recommend Python 2.7 or 3.4. Python 2.4 is 10 years old now.

Regards,

John

david-teasdale commented 9 years ago

Thank you

jmcnamara commented 9 years ago

@jmcnamara TODO. Add Python version check and warning to setup.py in next release.

jmcnamara commented 9 years ago

I've added a Python version check and warning to setup.py in version 0.6.4. Hopefully that will make it clearer in the future.

david-teasdale commented 9 years ago

John,

Is XlsWriter set up to convert csv files to XLSX ?

On line I got the impression that it could but I am not seeing it in the docs?

David Teasdale

david-teasdale commented 9 years ago

Btw the upgraded to 2.5.6 worked

jmcnamara commented 9 years ago

Is XlsWriter set up to convert csv files to XLSX

There isn't an example of converting CSV to XLSX in the distro but it should just be a matter of reading the CSV data with the standard Python module csv.py and then writing it with XlsxWriter.

Note, any data that you read with csv.py will be in string format so you may want to use the strings_to_numbers option in the constructor.