# PyError. Can't use ExcelReaders

**URL:** <https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247>\
**Category:** General Usage\
**Created:** [March 15, 2021, 10:51pm UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247 "2021-03-15T22:51:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaropro14](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Post date:** [March 15, 2021, 10:51pm UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247/1 "2021-03-15T22:51:58Z")

</div>

PyError ($(Expr(:escape, :(ccall(#= /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:43 =# @pysym(:PyObject\_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) \<class ‘xlrd.biffh.XLRDError’\>  
XLRDError(‘Excel xlsx file; not supported’)  
File “/Users/yaroslav/.julia/conda/3/lib/python3.8/site-packages/xlrd/ **init**.py”, line 170, in open\_workbook  
raise XLRDError(FILE\_FORMAT\_DESCRIPTIONS[file\_format]+‘; not supported’)

Stacktrace:  
[1] pyerr\_check at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/exception.jl:62 [inlined]  
[2] pyerr\_check at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/exception.jl:66 [inlined]  
[3] \_handle\_error(::String) at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/exception.jl:83  
[4] macro expansion at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/exception.jl:97 [inlined]  
[5] #109 at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:43 [inlined]  
[6] disable\_sigint at ./c.jl:446 [inlined]  
[7] \_\_pycall! at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:42 [inlined]  
[8] \_pycall!(::PyObject, ::PyObject, ::Tuple{String}, ::Int64, ::Ptr{Nothing}) at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:29  
[9] _pycall! at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:11 [inlined]  
[10] #_#116 at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:86 [inlined]  
[11] (::PyObject)(::String) at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:86  
[12] openxl(::String) at /Users/yaroslav/.julia/packages/ExcelReaders/PgE1r/src/ExcelReaders.jl:64  
[13] top-level scope at In[47]:3  
[14] include\_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1091

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 16, 2021, 7:02am UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247/2 "2021-03-16T07:02:03Z")

</div>

Hard to help without a MWE (please look at [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757))

That said, the error message seems clear - “Excel xlsx file; not supported”, so you are probably using an Excel reader that only allows reading `xls` format, not the newer `xlsx` format. I think the default reader used by pandas has recently dropped support for xlsx - here’s an SO question about it with suggested workaroudns: [python - xlrd.biffh.XLRDError: Excel xlsx file; not supported - Stack Overflow](https://stackoverflow.com/questions/65254535/xlrd-biffh-xlrderror-excel-xlsx-file-not-supported)

---

<div class="post-metadata">

**Author:** ![Yaropro14](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Post date:** [March 16, 2021, 11:30am UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247/3 "2021-03-16T11:30:27Z")

</div>

using ExcelReaders, JuMP, Plots, Gurobi  
cd(“/Users/yaroslav/Desktop/Diplom/”)  
file5=openxl(“ASG data 14.06.2018 (new data).xls”)

---

<div class="post-metadata">

**Author:** ![Yaropro14](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Post date:** [March 16, 2021, 11:31am UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247/4 "2021-03-16T11:31:02Z")

</div>

same error with xls  
using ExcelReaders, JuMP, Plots, Gurobi  
cd(“/Users/yaroslav/Desktop/Diplom/”)  
file5=openxl(“ASG data 14.06.2018 (new data).xls”)

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [March 16, 2021, 11:34am UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247/5 "2021-03-16T11:34:56Z")

</div>

I’d use XLSX.jl: [GitHub - felipenoris/XLSX.jl: Excel file reader and writer for the Julia language.](https://github.com/felipenoris/XLSX.jl) Maybe you’ll have better luck with that package.

---

<div class="post-metadata">

**Author:** ![Yaropro14](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Post date:** [March 16, 2021, 12:30pm UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247/6 "2021-03-16T12:30:01Z")

</div>

with . xls  
file5=openxl(“ASG-data-14.06.2018-_new-data_.xls”)

PyError ($(Expr(:escape, :(ccall(#= /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:43 =# @pysym(:PyObject\_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) \<class ‘xlrd.compdoc.CompDocError’\>  
CompDocError(‘Workbook corruption: seen[2] == 4’)  
File “/Users/yaroslav/.julia/conda/3/lib/python3.8/site-packages/xlrd/ **init**.py”, line 172, in open\_workbook  
bk = open\_workbook\_xls(  
File “/Users/yaroslav/.julia/conda/3/lib/python3.8/site-packages/xlrd/book.py”, line 68, in open\_workbook\_xls  
bk.biff2\_8\_load(  
File “/Users/yaroslav/.julia/conda/3/lib/python3.8/site-packages/xlrd/book.py”, line 641, in biff2\_8\_load  
cd.locate\_named\_stream(UNICODE\_LITERAL(qname))  
File “/Users/yaroslav/.julia/conda/3/lib/python3.8/site-packages/xlrd/compdoc.py”, line 398, in locate\_named\_stream  
result = self.\_locate\_stream(  
File “/Users/yaroslav/.julia/conda/3/lib/python3.8/site-packages/xlrd/compdoc.py”, line 429, in \_locate\_stream  
raise CompDocError(“%s corruption: seen[%d] == %d” % (qname, s, self.seen[s]))

Stacktrace:  
[1] pyerr\_check at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/exception.jl:62 [inlined]  
[2] pyerr\_check at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/exception.jl:66 [inlined]  
[3] \_handle\_error(::String) at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/exception.jl:83  
[4] macro expansion at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/exception.jl:97 [inlined]  
[5] #109 at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:43 [inlined]  
[6] disable\_sigint at ./c.jl:446 [inlined]  
[7] \_\_pycall! at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:42 [inlined]  
[8] \_pycall!(::PyObject, ::PyObject, ::Tuple{String}, ::Int64, ::Ptr{Nothing}) at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:29  
[9] _pycall! at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:11 [inlined]  
[10] #_#116 at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:86 [inlined]  
[11] (::PyObject)(::String) at /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:86  
[12] openxl(::String) at /Users/yaroslav/.julia/packages/ExcelReaders/PgE1r/src/ExcelReaders.jl:64  
[13] top-level scope at In[76]:5  
[14] include\_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1091

---

<div class="post-metadata">

**Author:** ![Yaropro14](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Post date:** [March 16, 2021, 6:32pm UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247/7 "2021-03-16T18:32:21Z")

</div>

Thanks a lot!
