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
Comments
@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? |
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. |
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). |
Was the problem solved? I mean grpcio continue failing on Python 3.9 |
@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.
using |
@ahtik That's unexpected. "pthread.h" shouldn't be involved at all on Windows. Can you please provide more detailed build logs? |
@gnossen The real cause could be elsewhere but Happy to help finding the cause and getting it built. |
@ahtik Can you upload the generated |
I also had the same problem, I had to uninstall version 3.9.0 and install 3.8.5. Everything works correctly :) |
@gnossen Windows 10, VS 2019 Build Tools 16.7.7.
|
@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. |
@eryksun Do you happen to have any ideas? |
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? |
@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 If not, please try to manually download and install the |
@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 |
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 . |
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!) |
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)
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): |
@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? |
@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 |
@lidizheng @gnossen I'll open up a new issue & apologies for the spam. I appreciate it's a lot to wade through. |
I'm trying to install grpcio using pip on Python 3.9 running on Windows 10.
It failed. Here is the log:
The text was updated successfully, but these errors were encountered: