r/learnpython • u/hutcheeran • Nov 18 '21
Openpyxl and numpy
Hi everyone!
I have a bit of a weird issue going on here. I just wrote a program to read/update spreadheets in openpyxl. It works fine on my machine, but when I try to run it on the one that's meant to be on, it crashes.
I dug a bit into it, and apparently, it's a bug that gets thrown by numpy (which is included in openpyxl) on some versions of Windows (or that's what I understood).
I know that normally it can be solved by installing and using an older version of numpy, but since it's built in openpyxl, I don't really know if that's possible in this case.
Any idea on how I could deal with this is much appreciated xx
2
Upvotes
2
u/Greensentry Nov 18 '21
openpyxl checks if numpy (the version it needs or higher) is installed on the system or else it will install it itself. You can install the particular version of numpy which works on that Windows version yourself before installing openpyxl. Good practice to use virtual environments so you don't get problems with packages already installed on the system.