Ying Ku
Ying Ku

Reputation: 33

pip install xlwings fails

I'm on MacOS Mojave Version 10.14.6, 2.8 GHz Intel Core i7 processor. Python version: 2.7.

"pip install xlwings" fails for me. I have tried to resolve this by upgrading setuptools with pip install -U setuptools

However, this does not fix the issue. The full error message for "pip install xlwings" is as follows:

Collecting xlwings
  Using cached xlwings-0.16.6.tar.gz (634 kB)
Collecting psutil>=2.0.0
  Using cached psutil-5.9.0.tar.gz (478 kB)
Collecting appscript>=1.0.1
  Using cached appscript-1.2.0.tar.gz (289 kB)
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-install-KTcWya/appscript/setup.py'"'"'; __file__='"'"'/private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-install-KTcWya/appscript/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-pip-egg-info-fmr2EU
         cwd: /private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-install-KTcWya/appscript/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/hm/pt6_h7xs52z7_89jqr614q300000gn/T/pip-install-KTcWya/appscript/setup.py", line 8, in <module>
        raise RuntimeError("Python 3.x required.")
    RuntimeError: Python 3.x required.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Upvotes: 2

Views: 776

Answers (1)

phd
phd

Reputation: 94706

xlwings declares appscript as a dependency but it doesn't limit version; appscript doesn't properly declare Python version compatibility (xlwings does it properly) so pip is trying to install the latest version which is not compatible with Python 2.7. Try to limit versions this way:

pip install "xlwings<0.17" "appscript<1.2"

Upvotes: 1

Related Questions