uchicago-library / library_website

The University of Chicago Library Website
5 stars 5 forks source link

Vagrant builds fail because of openpyxl #647

Closed bbusenius closed 1 year ago

bbusenius commented 1 year ago

Problem

New Vagrant builds fail with the following error because the save_virtual_workbook function was removed from openpyxl and we don't have that dependency pinned to a hard version:

ImportError: cannot import name 'save_virtual_workbook' from 'openpyxl.writer.excel' (/home/vagrant/lw/lib/python3.9/site-packages/openpyxl/writer/excel.py)

Steps to reproduce

Run: vagrant destroy and vagrant up.

Related materials

Related information

Related code

Other information:

This can easily be fixed temporarily by hard-pinning the openpyxl dependency to version 3.0.10 (the last version where the save_virtual_workbook function existed) in requirements.txt, however, it would be more prudent to set it as openpyxl>=3.1.0,<3.2.0 and fix our code using NamedTemporaryFile as mentioned in the code where this was deprecated.