我正在尝试在我的python垂直环境中安装apache-beam,但是没有用!我按照apache beam org [Apache Beam Python SDK Quickstart]提供的步骤进行,但是执行
时pip install apache-beam
我收到此错误:
Building wheels for collected packages: fastavro
Building wheel for fastavro (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/Shahad/Documents/Python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6w/yphgql792sn8c7jwcqlb81xw0000gn/T/pip-install-cvn3kfvs/fastavro/setup.py'"'"'; __file__='"'"'/private/var/folders/6w/yphgql792sn8c7jwcqlb81xw0000gn/T/pip-install-cvn3kfvs/fastavro/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/6w/yphgql792sn8c7jwcqlb81xw0000gn/T/pip-wheel-jr5srm8k
cwd: /private/var/folders/6w/yphgql792sn8c7jwcqlb81xw0000gn/T/pip-install-cvn3kfvs/fastavro/
Complete output (29 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/_schema_common.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/_schema_py.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/write.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/_write_py.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/_read_py.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/_read_common.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/_validate_common.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/_validation_py.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/six.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/_timezone.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/__main__.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/const.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/schema.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/read.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
copying fastavro/validation.py -> build/lib.macosx-10.9-x86_64-3.8/fastavro
running build_ext
building 'fastavro._read' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/fastavro
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/opt/anaconda3/envs/env1/include -arch x86_64 -I/usr/local/opt/anaconda3/envs/env1/include -arch x86_64 -I/Users/Shahad/Documents/Python/include -I/usr/local/opt/anaconda3/envs/env1/include/python3.8 -c fastavro/_read.c -o build/temp.macosx-10.9-x86_64-3.8/fastavro/_read.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for fastavro
OS:macOS Catalina 10.15.4
Python:3.8.2
有什么需要帮助的吗?谢谢。
尝试使用更新点子版本,
pip install -U pip
因为有时这也会引发错误。然后运行,>
sudo apt-get install python3-dev
如果不使用虚拟环境。如果使用虚拟环境,请使用
显式安装gcc编译器sudo apt-get install python-dev
请参考Solution以获取更多信息。并尝试使用
brew install gcc
希望这会有所帮助。