Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] pip install grpcio fails on Python 3.9 #24539

Closed
meticulousCraftman opened this issue Oct 22, 2020 · 21 comments
Closed

[Windows] pip install grpcio fails on Python 3.9 #24539

meticulousCraftman opened this issue Oct 22, 2020 · 21 comments

Comments

@meticulousCraftman
Copy link

I'm trying to install grpcio using pip on Python 3.9 running on Windows 10.
It failed. Here is the log:

Collecting grpcio
  Using cached grpcio-1.33.1.tar.gz (20.9 MB)
Requirement already satisfied: six>=1.5.2 in c:\users\kbhuv\appdata\roaming\python\python39\site-packages (from grpcio) (1.15.0)
Using legacy 'setup.py install' for grpcio, since package 'wheel' is not installed.
Installing collected packages: grpcio
    Running setup.py install for grpcio ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\kbhuv\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\kbhuv\\AppData\\Local\\Temp\\pip-install-exmxnphm\\grpcio\\setup.py'"'"'; __file__='"'"'C:\\Users\\kbhuv\\AppData\\Local\\Temp\\pip-install-exmxnphm\\grpcio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\kbhuv\AppData\Local\Temp\pip-record-lzd2ffg5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\kbhuv\appdata\local\programs\python\python39\Include\grpcio'
         cwd: C:\Users\kbhuv\AppData\Local\Temp\pip-install-exmxnphm\grpcio\
    Complete output (79 lines):
    ASM Builds for BoringSSL currently not supported on: win-amd64
    Found cython-generated files...
    running install
    running build
    running build_py
    running build_project_metadata
    creating python_build
    creating python_build\lib.win-amd64-3.9
    creating python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_auth.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_channel.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_common.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_compression.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_grpcio_metadata.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_interceptor.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_plugin_wrapping.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_runtime_protos.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_server.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_simple_stubs.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\_utilities.py -> python_build\lib.win-amd64-3.9\grpc
    copying src\python\grpcio\grpc\__init__.py -> python_build\lib.win-amd64-3.9\grpc
    creating python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_base_call.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_base_channel.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_base_server.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_call.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_channel.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_interceptor.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_metadata.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_server.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_typing.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\_utils.py -> python_build\lib.win-amd64-3.9\grpc\aio
    copying src\python\grpcio\grpc\aio\__init__.py -> python_build\lib.win-amd64-3.9\grpc\aio
    creating python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\implementations.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\interfaces.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\utilities.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\_client_adaptations.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\_metadata.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\_server_adaptations.py -> python_build\lib.win-amd64-3.9\grpc\beta
    copying src\python\grpcio\grpc\beta\__init__.py -> python_build\lib.win-amd64-3.9\grpc\beta
    creating python_build\lib.win-amd64-3.9\grpc\experimental
    copying src\python\grpcio\grpc\experimental\gevent.py -> python_build\lib.win-amd64-3.9\grpc\experimental
    copying src\python\grpcio\grpc\experimental\session_cache.py -> python_build\lib.win-amd64-3.9\grpc\experimental
    copying src\python\grpcio\grpc\experimental\__init__.py -> python_build\lib.win-amd64-3.9\grpc\experimental
    creating python_build\lib.win-amd64-3.9\grpc\framework
    copying src\python\grpcio\grpc\framework\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework
    creating python_build\lib.win-amd64-3.9\grpc\_cython
    copying src\python\grpcio\grpc\_cython\__init__.py -> python_build\lib.win-amd64-3.9\grpc\_cython
    creating python_build\lib.win-amd64-3.9\grpc\experimental\aio
    copying src\python\grpcio\grpc\experimental\aio\__init__.py -> python_build\lib.win-amd64-3.9\grpc\experimental\aio
    creating python_build\lib.win-amd64-3.9\grpc\framework\common
    copying src\python\grpcio\grpc\framework\common\cardinality.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
    copying src\python\grpcio\grpc\framework\common\style.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
    copying src\python\grpcio\grpc\framework\common\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\common
    creating python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\abandonment.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\callable_util.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\future.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\logging_pool.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\stream.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\stream_util.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    copying src\python\grpcio\grpc\framework\foundation\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\foundation
    creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces
    copying src\python\grpcio\grpc\framework\interfaces\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces
    creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
    copying src\python\grpcio\grpc\framework\interfaces\base\base.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
    copying src\python\grpcio\grpc\framework\interfaces\base\utilities.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
    copying src\python\grpcio\grpc\framework\interfaces\base\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\base
    creating python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
    copying src\python\grpcio\grpc\framework\interfaces\face\face.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
    copying src\python\grpcio\grpc\framework\interfaces\face\utilities.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
    copying src\python\grpcio\grpc\framework\interfaces\face\__init__.py -> python_build\lib.win-amd64-3.9\grpc\framework\interfaces\face
    creating python_build\lib.win-amd64-3.9\grpc\_cython\_cygrpc
    copying src\python\grpcio\grpc\_cython\_cygrpc\__init__.py -> python_build\lib.win-amd64-3.9\grpc\_cython\_cygrpc
    creating python_build\lib.win-amd64-3.9\grpc\_cython\_credentials
    copying src\python\grpcio\grpc\_cython\_credentials\roots.pem -> python_build\lib.win-amd64-3.9\grpc\_cython\_credentials
    running build_ext
    error: [WinError 2] The system cannot find the file specified
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\kbhuv\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\kbhuv\\AppData\\Local\\Temp\\pip-install-exmxnphm\\grpcio\\setup.py'"'"'; __file__='"'"'C:\\Users\\kbhuv\\AppData\\Local\\Temp\\pip-install-exmxnphm\\grpcio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\kbhuv\AppData\Local\Temp\pip-record-lzd2ffg5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\kbhuv\appdata\local\programs\python\python39\Include\grpcio' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available.
You should consider upgrading via the 'c:\users\kbhuv\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.
@gnossen
Copy link
Contributor

gnossen commented Oct 22, 2020

@meticulousCraftman This comes down to your version of Python: 3.9, which is very new. We do not yet have precompiled artifacts for it, so your install is falling back to a from-source build. Do you have a compiler installed, like Visual Studio?

@lidizheng
Copy link
Contributor

Link to another 3.9 issue: #24344.

There are still issues with our Windows CI. We will publish precompiled Windows wheels for 3.9 once that tis fixed.

@meticulousCraftman
Copy link
Author

No, I don't have Visual Studio. I have Microsoft Visual C++ 2015 Redistributable installed (I don't know if this is of any use).
I switched my Python back to version 3.8 for the time being. Everything works fine now.

@cafegoci
Copy link

cafegoci commented Oct 27, 2020

Was the problem solved? I mean grpcio continue failing on Python 3.9

@ahtik
Copy link

ahtik commented Oct 27, 2020

@cafegoci Windows wheels for Python 3.9 are being tracked by #24344

OSX and Linux wheels are already available.

Windows build with Python 3.9 using VS 2019 Build Tools is also failing for me, hopefully it gets fixed together with #24344.
Mine fails with

src\python\grpcio\grpc/_cython/cygrpc.cpp(1680): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory

using
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe

@gnossen
Copy link
Contributor

gnossen commented Oct 27, 2020

@ahtik That's unexpected. "pthread.h" shouldn't be involved at all on Windows. Can you please provide more detailed build logs?

@ahtik
Copy link

ahtik commented Oct 27, 2020

@gnossen The real cause could be elsewhere but pthread.h was the only fatal error I noticed.
Attaching the full pip install grpcio logs, search fatal error for the pthread.h issue.

Happy to help finding the cause and getting it built.
grpcio-build.log

@gnossen
Copy link
Contributor

gnossen commented Oct 27, 2020

@ahtik Can you upload the generated cygrpc.cpp file that's referencing pthread.h?

@eduardobg
Copy link

I also had the same problem, I had to uninstall version 3.9.0 and install 3.8.5. Everything works correctly :)

@ahtik
Copy link

ahtik commented Oct 28, 2020

@gnossen
python -VV: Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]
Empty venv with only wheel 0.35.1 and pip 20.2.4 installed.

Windows 10, VS 2019 Build Tools 16.7.7.
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\bin\HostX86\x64\cl.exe"
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x64

python -c "import platform; print(platform.system())": Windows

cygrpc.cpp:
image

cygrpc.zip

@ahtik
Copy link

ahtik commented Nov 1, 2020

@gnossen Any hints what could be checked to figure out why the pthread.h include sneaked in? The logs attached to my prev comment have a few platform-name related warnings, not sure if related.

@ofek
Copy link

ofek commented Nov 1, 2020

@eryksun Do you happen to have any ideas?

@murphyj8
Copy link

GRPCIO-TOOLS fails to build on macox (Big Sur) with python3.9 and Apple clang version 12.0.0 (clang-1200.0.32.28). It fails to find a binary wheel instead downloading the source code and trying to build it. The error list is gigantic. Any chance you could update the binary wheel to support python3.9?

@lidizheng
Copy link
Contributor

@murphyj8 Are you using the latest Apple M1? If so, then you need arm64 binary wheels instead of x86_64 wheels. We currently don't have arm64 machines to build binary wheels, so you will need to use arch -x86_64 to emulate x86_64 architecture.

If not, please try to manually download and install the grpcio-tools wheel (https://pypi.org/project/grpcio-tools/#files).

@murphyj8
Copy link

@lidizheng Hello, thank you for your response. I have an intel based based so the x86_64 should world. I was unable to use the wheel files directly. And when I follow the instructions in the README about building grpcio-tools from source I get the following error. For the record I'm using python3.9 & I have built & installed grpc v1.34.

~/grpcClone/grpc/tools/distrib/python/grpcio_tools(64c6cfc) » python ../make_grpcio_tools.py
Invoking "bazel query" to gather the protobuf dependencies.
Running "bazel query //:protoc_lib"
INFO: Running bazel wrapper (see //tools/bazel for details), bazel version 2.2.0 will be used instead of system-wide bazel installation.
Downloading bazel, will try URLs: https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/bazel/releases/download/2.2.0/bazel-2.2.0-darwin-x86_64 https://github.com/bazelbuild/bazel/releases/download/2.2.0/bazel-2.2.0-darwin-x86_64
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 38.9M 100 38.9M 0 0 4052k 0 0:00:09 0:00:09 --:--:-- 4812k
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
currently loading:
Loading: 1 packages loaded
Loading: 7 packages loaded
Loading: 7 packages loaded
Loading: 9 packages loaded
Loading: 9 packages loaded
Got non-fatal error:
Traceback (most recent call last):
File "/Users/j.murphy/grpcClone/grpc/tools/distrib/python/grpcio_tools/../make_grpcio_tools.py", line 161, in main
protoc_lib_deps_content = get_deps()
File "/Users/j.murphy/grpcClone/grpc/tools/distrib/python/grpcio_tools/../make_grpcio_tools.py", line 110, in get_deps
cc_files = [
File "/Users/j.murphy/grpcClone/grpc/tools/distrib/python/grpcio_tools/../make_grpcio_tools.py", line 113, in
if name.endswith('.cc') and name.startswith(PROTOBUF_CC_PREFIX)
TypeError: endswith first arg must be bytes or a tuple of bytes, not str

@murphyj8
Copy link

hello @lidizheng, I tried to edit the python file make_grpcio_tools.py. There seems to be a few issues with some changes to python3.9 around handling str & byte types. After making a few edits, the build when a bit further but now it's failing again at the step shown below. Again, it appears to be str & byte related. My guess is something has changed in python3.9 with regard to these types being returned from some system functions. The error message is below & is similar to the one I get when trying to install from the wheel file. Did you do a wheel build with python3.9 by any chance?

GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip3 install .
Processing /Users/j.murphy/grpcClone/grpc/tools/distrib/python/grpcio_tools
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-req-build-3gfie31o/setup.py'"'"'; file='"'"'/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-req-build-3gfie31o/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/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-pip-egg-info-jf10yz0a
cwd: /private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-req-build-3gfie31o/
Complete output (13 lines):
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-req-build-3gfie31o/setup.py", line 230, in
ext_modules=extension_modules(),
File "/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-req-build-3gfie31o/setup.py", line 196, in extension_modules
] + [os.path.join(CC_INCLUDE, cc_file) for cc_file in CC_FILES]
File "/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-req-build-3gfie31o/setup.py", line 196, in
] + [os.path.join(CC_INCLUDE, cc_file) for cc_file in CC_FILES]
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/posixpath.py", line 90, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/genericpath.py", line 155, in _check_arg_types
raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

@murphyj8
Copy link

hello @lidizheng, apologies, I appear to be spamming you quite a bit. So, it looks like some changes have been made to python3.9 behind the scenes. An example is with subprocess.check_output (which is used in make_grpcio_tools.py (line 95)). It's now returning bytes according to the python doc (https://docs.python.org/3/library/subprocess.html#subprocess.check_output). And there is a recommendation that the conversion to str should be handled at the application level. It's a similar story for 'endswith' and 'beginswith' calls. Although that may have something to do with the return from Bazel_query(BAZEL_DEPS_PROTOC_LIB_QUERY) return.

All the errors I'm getting are a bit similar to be dismissed.

What's making this really hard is 'downgrading' the version of python on the MAC is really hard. So, I'm trying to figure out which is the least worst approach (grpcio_tools with python3.9 feels easier right now!)

@murphyj8
Copy link

hello @lidizheng, please see below for the error I'm getting when trying to install the grpcio tools for python. Again, it's python 3.9 with macOS Big Sur and clang version

Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

----------------------------------------

ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-install-tl7mjysu/grpcio/setup.py'"'"'; file='"'"'/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-install-tl7mjysu/grpcio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-record-pk3s16fg/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/grpcio Check the logs for full command output.

There is a huge number of clang errors that arrive right before this one. Here's an example.

Traceback (most recent call last):
File "/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-install-tl7mjysu/grpcio/src/python/grpcio/commands.py", line 267, in build_extensions
build_ext.build_ext.build_extensions(self)
File "/usr/local/lib/python3.9/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/usr/local/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
_build_ext.build_extension(self, ext)
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/build_ext.py", line 529, in build_extension
objects = self.compiler.compile(sources,
File "/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-install-tl7mjysu/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 58, in _parallel_compile
multiprocessing.pool.ThreadPool(BUILD_EXT_COMPILER_JOBS).map(
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-install-tl7mjysu/grpcio/src/python/grpcio/_parallel_compile_patch.py", line 54, in _compile_single_file
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/private/var/folders/sh/ml_cqh3d6vn8f4f__yx0p34d62kd9k/T/pip-install-tl7mjysu/grpcio/src/python/grpcio/commands.py", line 250, in new_compile
return old_compile(obj, src, ext, cc_args, extra_postargs,
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command '/usr/bin/clang' failed with exit code 1

@gnossen
Copy link
Contributor

gnossen commented Jan 26, 2021

@murphyj8 There's a lot of log spam when a compilation fails. Unfortunately, the section you excerpted doesn't include the relevant clang failure. Can you please include the full error message?

@lidizheng lidizheng changed the title pip install grpcio fails on Python 3.9 [Windows] pip install grpcio fails on Python 3.9 Jan 26, 2021
@lidizheng
Copy link
Contributor

@murphyj8 Can you open up a new issue for the compilation error on macOS (it helps people to find it in future)? Generally, we recommend to use binary wheels instead of compile from scratch which is very sensitive to the environment.

Please update your pip, and then download the corresponding wheel (https://pypi.org/project/grpcio/#files). For 3.9 on mac, it should be this one: https://files.pythonhosted.org/packages/92/2d/e316d543e29fd7987390563f65861d438cd236094cc373e279abdc6cd53e/grpcio-1.35.0-cp39-cp39-macosx_10_10_x86_64.whl.

@murphyj8
Copy link

@lidizheng @gnossen I'll open up a new issue & apologies for the spam. I appreciate it's a lot to wade through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants