无法在Thonny中安装Biopython,遇Python.h缺失及pip未找到问题
安装Biopython遇到的问题及报错详情
一、Thonny中安装Biopython的报错
执行安装后出现编译错误,具体信息如下:
-I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c Bio/Align/_aligners.c -o build/temp.macosx-10.9-universal2-cpython-310/Bio/Align/_aligners.o Bio/Align/_aligners.c:11:10: fatal error: 'Python.h' file not found #include "Python.h" ^~~~~~~~~~ 1 error generated. error: command '/usr/bin/clang' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> biopython note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure. Process returned with code 1
核心错误为*'Python.h' file not found*,导致clang编译失败。
二、bash终端手动安装的报错
在终端执行安装命令时,出现命令未找到提示:
pip install Biopython -bash: pip: command not found
已尝试的解决操作
- 重新安装Thonny,但问题仍未解决
补充说明:Thonny是面向初学者的Python IDE
内容的提问来源于stack exchange,提问作者Nick Wi
相关产品推荐
相关产品推荐

