当我使用pypy3.6-v7.3.1安装grpcio时,它有一些错误
cc1plus: warning: command line option ‘-std=gnu99’ is valid for C/ObjC but not for C++ [enabled by default]
gcc -pthread -DNDEBUG -O2 -fPIC -D_WIN32_WINNT=1536 -DGPR_BACKWARDS_COMPATIBILITY_MODE=1 -DHAVE_CONFIG_H=1 -DGRPC_ENABLE_FORK_SUPPORT=1 -DPyMODINIT_FUNC=extern "C" __attribute__((visibility ("default"))) PyObject* -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 -Isrc/python/grpcio -Iinclude -I. -Ithird_party/abseil-cpp -Ithird_party/address_sorting/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/cares/config_linux -Ithird_party/re2 -Ithird_party/boringssl-with-bazel/src/include -Ithird_party/upb -Isrc/core/ext/upb-generated -Isrc/core/ext/upbdefs-generated -Ithird_party/zlib -I/usr/local/pypy3.6-v7.3.1/include -c third_party/boringssl-with-bazel/src/ssl/tls_record.cc -o python_build/temp.linux-x86_64-3.6/third_party/boringssl-with-bazel/src/ssl/tls_record.o -std=c++11 -std=gnu99 -fvisibility=hidden -fno-wrapv -fno-exceptions -pthread
cc1plus: warning: command line option ‘-std=gnu99’ is valid for C/ObjC but not for C++ [enabled by default]
creating None/tmp/tmpdspzk75c
gcc -pthread -DNDEBUG -O2 -fPIC -I/usr/local/pypy3.6-v7.3.1/include -c /tmp/tmpdspzk75c/a.c -o None/tmp/tmpdspzk75c/a.o
Traceback (most recent call last):
File "/usr/local/pypy3.6-v7.3.1/lib-python/3/distutils/unixccompiler.py", line 133, in _compile
extra_postargs)
File "/tmp/pip-install-0n4wn2nk/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
_classic_spawn(self, command)
File "/usr/local/pypy3.6-v7.3.1/lib-python/3/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/local/pypy3.6-v7.3.1/lib-python/3/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/local/pypy3.6-v7.3.1/lib-python/3/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
它仅告诉我gcc失败,没有更多原因,您能帮我吗?
我的容器是:
在同一个Docker容器中, 我尝试使用pypy2.7或python3安装grpcio,没有问题。
答案 0 :(得分:0)
如果它适合您的需求,您可以尝试使用 grpcio==1.26.0。 该版本在 pypy3 + gcc 9.3.0 上编译得很好,至少在我的 wsi ubuntu 上是这样。
pip install grpcio==1.26.0