1

I'm trying to pip install grequests on Windows 10, but it errors out when it attempts to install gevent.

I'll be grateful for any clues on how to resolve this. (FWIW, I also tried pip --no-cache-dir install gevent, amongst other variants. They all failed the same way - please see below).

# pip3 --version
pip 20.0.2 from c:\users\username\appdata\local\programs\python\python38\lib\site-packages\pip (python 3.8)
# python --version
Python 3.8.1

# pip3 install grequests
Collecting grequests
  Using cached grequests-0.4.0-py3-none-any.whl (4.6 kB)Collecting gevent
  Using cached gevent-1.4.0.tar.gz (5.2 MB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\username\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-_nbp9r04\\gevent\\setup.py'"'"'; __file__='"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-_nbp9r04\\gevent\\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 'C:\Users\username\AppData\Local\Temp\pip-install-_nbp9r04\gevent\pip-egg-info'
         cwd: C:\Users\username\AppData\Local\Temp\pip-install-_nbp9r04\gevent\
    Complete output (113 lines):
    Traceback (most recent call last):
      File "c:\users\username\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
        return self.find_available_vc_vers()[-1]
    IndexError: list index out of range

    During handling of the above exception, another exception occurred:
Matt Muggeridge
  • 465
  • 3
  • 11
  • Did you install the visual c++ build tools, as the error message probably urges you later in the log? – hoefling Feb 14 '20 at 14:55
  • Thanks. I found at the bottom it stated: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": visualstudio.microsoft.com/downloads Unfortunately, that website doesn't list "MS Visual C++ Build Tools". I tried installing "Microsoft Visual C++ Redistributable for Visual Studio 2019", but it didn't solve the problem. I then found it in: "Build Tools for Visual Studio 2019". Though, it wants 1.59GB to install MSVC v142!!! I'm hoping this cannot be right. This runs under Python 3.6, but needs 1.59GB to run under 3.8? I must be missing something? – Matt Muggeridge Feb 17 '20 at 08:31
  • No, you are not mistaken, you need space to install the compiler on windows. Btw you don't need the redistributable for this - it's only there for running already compiled code. – hoefling Feb 17 '20 at 08:36
  • The reason for this is that Python 3.8 is still new so not all libraries have released precompiled wheels for it. If you're not experienced with building code, the easiest solution IMO would be downgrade to Python 3.7 for a while. If you want/need to use 3.8, you can try out the wheel from [Christopher Gohlke's collection](https://www.lfd.uci.edu/~gohlke/pythonlibs/), but the only version prebuilt for 3.8 it contains is the 1.5 alpha of `greenlet` which is not guaranteed to be stable. – hoefling Feb 17 '20 at 08:41
  • Thankyou hoefling! Much appreciate all the info. Yes, I will recommend folks stick with 3.7, at least until the 'precompiled wheels' roll out. Cheers! – Matt Muggeridge Feb 17 '20 at 11:25
  • Glad I could help! – hoefling Feb 17 '20 at 12:05

0 Answers0