当前位置:   article > 正文

Mac M1 安装grpcio报错解决方法_you're on mac os x and the usual python framework

you're on mac os x and the usual python framework was somehow corrupted

版本:grpcio=1.14.0

先说结论,执行以下步骤解决:

  1. python3 -m pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple setuptools
  2. pip3 install --no-cache-dir --force-reinstall -i https://pypi.tuna.tsinghua.edu.cn/simple -Iv grpcio==1.40.0

解决前遇到的报错信息:
 

  1. creating None
  2. creating None/var
  3. creating None/var/folders
  4. creating None/var/folders/dd
  5. creating None/var/folders/dd/q2kqqlbx7ls6r9dz4ywsjnn40000gn
  6. creating None/var/folders/dd/q2kqqlbx7ls6r9dz4ywsjnn40000gn/T
  7. creating None/var/folders/dd/q2kqqlbx7ls6r9dz4ywsjnn40000gn/T/tmplfv591p1
  8. clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/blue/code/github/thingsboard-gateway/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c /var/folders/dd/q2kqqlbx7ls6r9dz4ywsjnn40000gn/T/tmplfv591p1/a.c -o None/var/folders/dd/q2kqqlbx7ls6r9dz4ywsjnn40000gn/T/tmplfv591p1/a.o
  9. /var/folders/dd/q2kqqlbx7ls6r9dz4ywsjnn40000gn/T/tmplfv591p1/a.c:2:10: fatal error: 'Python.h' file not found
  10. #include <Python.h>
  11. ^~~~~~~~~~
  12. 1 error generated.
  13. Could not find <Python.h>. This could mean the following:
  14. * You're on Ubuntu and haven't run `apt-get install python3-dev`.
  15. * You're on RHEL/Fedora and haven't run `yum install python3-devel` or
  16. `dnf install python3-devel` (make sure you also have redhat-rpm-config
  17. installed)
  18. * You're on Mac OS X and the usual Python framework was somehow corrupted
  19. (check your environment variables or try re-installing?)
  20. * You're on Windows and your Python installation was somehow corrupted
  21. (check your environment variables or try re-installing?)
  22. Traceback (most recent call last):
  23. File "/Users/blue/code/github/thingsboard-gateway/venv/lib/python3.8/site-packages/setuptools/_distutils/unixccompiler.py", line 186, in _compile
  24. self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
  25. File "/private/var/folders/dd/q2kqqlbx7ls6r9dz4ywsjnn40000gn/T/pip-install-y_rm53hj/grpcio_ddf3b4cb9c7b403793ab646e6c088fc8/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
  26. _classic_spawn(self, command)
  27. File "/Users/blue/code/github/thingsboard-gateway/venv/lib/python3.8/site-packages/setuptools/_distutils/ccompiler.py", line 1007, in spawn
  28. spawn(cmd, dry_run=self.dry_run, **kwargs)
  29. File "/Users/blue/code/github/thingsboard-gateway/venv/lib/python3.8/site-packages/setuptools/_distutils/spawn.py", line 70, in spawn
  30. raise DistutilsExecError(
  31. distutils.errors.DistutilsExecError: command '/usr/bin/clang' failed with exit code 1

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/956844
推荐阅读
相关标签
  

闽ICP备14008679号