"pip3安装蝙蝠侠软件包"不起作用



使用macOS 10.15.6,我已经通过自制程序(2.4.9(安装了python3(3.8.5(。然后我使用pip3(20.2(安装了我需要的软件包。

但当我想安装一个名为";蝙蝠侠";。我首先使用pip3 install batman安装它,但后来我发现正确的方法是使用pip3 install batman-package,只是这样做会给我一个很长的错误消息,我试图理解,但我还没有弄清楚我需要修复什么,所以我想问是否有人能修复它?

感谢

Collecting batman-package
Using cached batman-package-2.4.6.tar.gz (29 kB)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from batman-package) (1.19.0)
Building wheels for collected packages: batman-package
Building wheel for batman-package (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-wheel-9fvrwe2s
cwd: /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/
Complete output (25 lines):
Checking for OpenMP support...
Did not detect OpenMP support.
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extras_requires'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.8
creating build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/openmp.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/transitmodel.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/plots.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/tests.py -> build/lib.macosx-10.15-x86_64-3.8/batman
running build_ext
building 'batman._nonlinear_ld' extension
creating build/temp.macosx-10.15-x86_64-3.8
creating build/temp.macosx-10.15-x86_64-3.8/c_src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c_src/_nonlinear_ld.c -o build/temp.macosx-10.15-x86_64-3.8/c_src/_nonlinear_ld.o -std=c99
c_src/_nonlinear_ld.c:21:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for batman-package
Running setup.py clean for batman-package
Failed to build batman-package
DEPRECATION: Could not build wheels for batman-package which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: batman-package
Running setup.py install for batman-package ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-record-a9qct8l8/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/batman-package
cwd: /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/
Complete output (25 lines):
Checking for OpenMP support...
Did not detect OpenMP support.
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extras_requires'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.8
creating build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/openmp.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/transitmodel.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/plots.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/tests.py -> build/lib.macosx-10.15-x86_64-3.8/batman
running build_ext
building 'batman._nonlinear_ld' extension
creating build/temp.macosx-10.15-x86_64-3.8
creating build/temp.macosx-10.15-x86_64-3.8/c_src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c_src/_nonlinear_ld.c -o build/temp.macosx-10.15-x86_64-3.8/c_src/_nonlinear_ld.o -std=c99
c_src/_nonlinear_ld.c:21:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-record-a9qct8l8/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/batman-package Check the logs for full command output.

好的,所以正如thilina lakshan所说,这实际上是一个头部问题。我遵循了他发布的链接,事实上,通过在终端中运行export CFLAGS="-I /usr/local/lib/python3.8/site-packages/numpy/core/include $CFLAGS",我可以安装软件包。

非常非常感谢!

最新更新