1

I'm trying to install xlwings in a Mac with Ventura 13.0. When I try to launch it (after importing it successfully, in a Jupiter notebook) I get this error msg: 'Make sure to have "appscript" and "psutil", dependencies of xlwings, installed.' If I try to reinstall it, I get:

Requirement already satisfied: xlwings in /Users/GFB/.venvs/aapy/lib/python3.10/site-packages (0.28.3)
Requirement already satisfied: appscript>=1.0.1 in /Users/GFB/.venvs/aapy/lib/python3.10/site-packages (from xlwings) (1.2.1)
Requirement already satisfied: psutil>=2.0.0 in /Users/GFB/.venvs/aapy/lib/python3.10/site-packages (from xlwings) (5.9.3)
Requirement already satisfied: lxml>=4.7.1 in /Users/GFB/.venvs/aapy/lib/python3.10/site-packages (from appscript>=1.0.1->xlwings) (4.9.1)

I've uninstalled dumpy, pandas and xlwings and reinstalled them in that order with conda ... I also updated wheel and then reinstalled xlwing, but I continue to get the same message

1 Answers1

0

I just did some research into this problem because a co-worker had the same issue and didn't find any answers here.

As it turns out, in our case anyway, the error was a misdirection. The dependencies were indeed installed, but there was an error while importing the Excel driver for Mac, which was caught and masked over with this one.

I'm not sure exactly what was wrong, but when I unmasked the error underneath, the real issue was with dlopen locating a particular symbol in a .so binary within lxml, so I tried forcing pip to recompile lxml's C extensions from source using the following command:

python3 -m pip install --force-reinstall --ignore-installed --no-binary :all: lxml

After running this command, xlwings started to work again

I found this command on the following StackOverflow post, and adapted it to fit our needs: Forcing `pip` to recompile a previously installed package (numpy) after switching to a different Python binary

Hope this helps!