Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

807
Visualizações
python 3.5 -> 3.6 Tablib TypeError: cell() missing 1 required positional argument: 'column'

Migrating from python 3.5 to 3.6, my unit tests reveal a problem with django-import-export & tablib:

TypeError: cell() missing 1 required positional argument: 'column'

File "<path>/lib/python3.6/site-packages/tablib/formats/_xlsx.py", line 122, in dset_sheet
    cell = ws.cell('%s%s' % (col_idx, row_number))
    TypeError: cell() missing 1 required positional argument: 'column'

The line in tablib:

    cell = ws.cell('%s%s' % (col_idx, row_number))

So indeed, there is no argument for the column

My view code:

my_resource = MyModelResource(queryset=my_queryset)
dataset = my_resource.export()
response = HttpResponse(dataset.xlsx, content_type='application/vnd.ms-excel')

This works fine in python3.5 but fails under 3.6

requirements.txt:

...
tablib==0.12.1
django-import-export==0.7.0
Django==1.11.7
...
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This has nothing to do with Python 3.5 or 3.6. You have a newer openpyxl version installed with your 3.6 installation compared to your 3.5 setup.

The version you have installed with 3.6 has removed the deprecated coordinate parameter from worksheet.cell() method and made the row and column mandatory arguments. This is part of version 2.5.0b1, released on 2018-01-19 (two weeks ago):

Major Changes

worksheet.cell() no longer accepts a coordinate parameter. The syntax is now ws.cell(row, column, value=None)

The tablib library has not yet adjusted to this change. The code should just pass in the column and row numbers directly:

cell = ws.cell(row=row_number, column=col_idx)

Using keyword arguments would ensure compatibility all the way back to 1.1.0 (the release that added support for the column and row parameters, released in 2010).

In the meantime, you can downgrade your openpyxl installation to version 2.4.9, the last release without those changes.

Also see issue #324 in the tablib project repository.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda