非零退出码 (1):_pydevd_bundle/pydevd_cython.c:13:20: 致命错误:Python.h:没有那个文件或目录 编译终止。 错误:命令 'x86_64-linux-gnu-gcc' 失败,退出状态为1
请帮我解决在 PyCharm 中尝试安装 Cython 时出现的此错误。
非零退出码 (1):_pydevd_bundle/pydevd_cython.c:13:20: 致命错误:Python.h:没有那个文件或目录 编译终止。 错误:命令 'x86_64-linux-gnu-gcc' 失败,退出状态为1
请帮我解决在 PyCharm 中尝试安装 Cython 时出现的此错误。
JetBrains提供了答案:
https://www.jetbrains.com/help/pycharm/2017.3/cython-speedups.html
如果你使用Ubuntu系统,请运行以下命令:
对于Python 2.7: sudo apt-get install python-dev
对于Python 3.5: sudo apt-get install python3-dev
对于Python 3.6: sudo apt-get install python3.6-dev
对于Python 3.7: sudo apt-get install python3.7-dev
sudo yum install python36-devel
。 - Noam Manossudo apt-get install python3.7-dev
解决了这个问题。 - lucribsudo apt-get install python3.8-dev
。 - Thomas Fritzpython
。sudo apt-get install python<your_bin_version>-dev
。
注意:请在usr/bin
中使用which python
查找。python
不识别conda setuptools
。sudo apt-get install python3-setuptools
。sudo /usr/bin/python3 /<your_pycharm_installation_dir>/pycharm-2021.1/plugins/python/helpers/pydev/setup_cython.py build_ext --inplace
只有在使用基本的Python时,它才能正常工作......
接下来,我找到了最近构建的目录/_pydevd_bundle
并手动(是的)将其复制到了......
/<your conda environmenbt>/.conda/envs/py39web/compiler_compat
对于Python 3.7版本,sudo apt install libpython3.7-dev
解决了我的问题。
适用于Python 3.9版本
sudo apt-get install python3.9-dev