1

I installed Qpython3 and openpyxl (through pip) onto my Lenovo A3300-H tablet (Android 4.4.2). Both installations went ok, but when I tried an "import openpyxl" on the console, I got an error message apparently related to a syntax-related error in openpyxl :


/data/data/com.hipipal.qpy3/files/bin/qpython.sh && exit /files/bin/qpython.sh && exit < Python 3.2.2 (default, Jun 18 2015, 19:03:02) [GCC 4.9 20140827 (prerelease)] on linux-armv7l Type "help", "copyright", "credits" or "license" for more information.

import openpyxl Traceback (most recent call last): File "", line 1, in File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/openpyxl/init.py", line 29, in from openpyxl.workbook import Workbook File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/openpyxl/workbook/init.py", line 5, in from .workbook import Workbook File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/openpyxl/workbook/workbook.py", line 8, in from openpyxl.worksheet import Worksheet File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/openpyxl/worksheet/init.py", line 4, in from .worksheet import Worksheet File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/openpyxl/worksheet/worksheet.py", line 23, in from openpyxl.utils import ( File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/openpyxl/utils/init.py", line 5, in from .cell import ( File "/data/data/com.hipipal.qpy3/files/lib/python3.2/site-packages/openpyxl/utils/cell.py", line 202 sheetname = u"'{0}'".format(sheetname) ^ SyntaxError: invalid syntax


The above text does not reflect the code exactly, so here is a Dropbox link of an image of the copy/paste : https://www.dropbox.com/s/8mmqpz69vs6wy0z/ErrorMsg_import_openpyxl_in_Qpython3_Android.PNG?dl=0. Just in case.

Now, I uninstalled and re-installed both Qpython3 and openpyxl, to no avail.

Any idea ? I must add that I also tried to install numpy on the same tablet a few times, without any success (the pip install itself failed).

Thanks in advance for your help.

Alain

achamoux
  • 11
  • 3

2 Answers2

0

Python 3.2 is not supported by openpyxl because it cannot handle the unicode literal u""

Charlie Clark
  • 18,477
  • 4
  • 49
  • 55
  • Thanks. So I guess I'll have to wait Qpython3 upgrade their version of Python. Probable it was the same problem that prevented me to install numpy. – achamoux Jul 25 '16 at 14:29
0

As Charlie Clark said, the latest version of openpyxl doesn't support python 3.2. But version 2.0.2 does support python 3.2, so in the meantime you could use that version instead by passing the right flags to pip. See this question for details.

Community
  • 1
  • 1
Ryan1729
  • 940
  • 7
  • 25