Python Pycharm:编译Cython扩展错误-无法执行';gcc';:没有这样的文件或目录
在Ubuntu 14.04上,我使用Pycharm专业版。启动调试会话时,我在Pycharm的事件日志中看到以下消息: Python调试器扩展可用 Cython扩展加速了Python调试 单击Python Pycharm:编译Cython扩展错误-无法执行';gcc';:没有这样的文件或目录,python,pycharm,cython,Python,Pycharm,Cython,在Ubuntu 14.04上,我使用Pycharm专业版。启动调试会话时,我在Pycharm的事件日志中看到以下消息: Python调试器扩展可用 Cython扩展加速了Python调试 单击Install将弹出一个带有错误消息的窗口: 我在这里也描述了文本,以便其他人更容易找到: 编译Cython扩展错误 非零退出代码(1): 无法执行“gcc”:没有这样的文件或目录 错误:命令“gcc”失败,退出状态为1 要寻找解决方案,请执行以下操作: 我根据上面提到的链接手动编译了Cython加速版
Install
将弹出一个带有错误消息的窗口:
我在这里也描述了文本,以便其他人更容易找到:
编译Cython扩展错误
非零退出代码(1):
无法执行“gcc”:没有这样的文件或目录
错误:命令“gcc”失败,退出状态为1
要寻找解决方案,请执行以下操作:
/usr/bin/python3//helpers/pydev/setup\u Cython.py build\u ext--inplace
。这将成功完成,但对错误消息没有帮助sudo-add-apt-repository-ppa:deadsnakes/ppa
,执行:sudo-apt-get-update&&sudo-apt-get-dist-upgrade
并安装了python-3.6-dev:sudo-apt-get-install-python3.6-dev
它成功完成,但不会更改上述弹出错误消息user@user-computer:~$ gcc
The program 'gcc' is currently not installed. You can install it by typing:
sudo apt-get install gcc
user@user-computer:~$ sudo apt-get install gcc
[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc is already the newest version.
The following packages were automatically installed and are no longer required:
libseccomp2 libwireshark5 libwiretap4 libwsutil4
linux-image-3.13.0-160-generic linux-image-extra-3.13.0-160-generic
linux-lts-xenial-tools-4.4.0-137 linux-signed-image-4.4.0-137-generic
linux-tools-4.4.0-137-generic squashfs-tools
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
user@user-computer:~$ gcc
The program 'gcc' is currently not installed. You can install it by typing:
sudo apt-get install gcc
供日后参考:
Cython
使用gcc
(默认情况下),需要验证它是否已安装且工作正常。
由于它默认安装在最新的
Ubuntu
发行版上,如果它工作不正常,您可以按照OP-fix并使用sudo-apt-install——重新安装gcc
,以备将来参考:
Cython
使用gcc
(默认情况下),需要验证它是否已安装且工作正常。
由于它默认安装在最新的
Ubuntu
发行版上,如果它工作不正常,您可以按照OP fix的要求使用sudo apt install——首先重新安装gcc
:
sudo apt install --reinstall gcc
然后运行下面的命令,具体取决于您使用的Python
版本:
对于Python 2.x,请使用:
$ sudo apt-get install python-dev
$ sudo apt-get install python3-dev
$ sudo apt-get install python3.8-dev
对于Python 3.x使用:
$ sudo apt-get install python-dev
$ sudo apt-get install python3-dev
$ sudo apt-get install python3.8-dev
对于Python 3.8,请使用:
$ sudo apt-get install python-dev
$ sudo apt-get install python3-dev
$ sudo apt-get install python3.8-dev
首先:
sudo apt install --reinstall gcc
然后运行下面的命令,具体取决于您使用的Python
版本:
对于Python 2.x,请使用:
$ sudo apt-get install python-dev
$ sudo apt-get install python3-dev
$ sudo apt-get install python3.8-dev
对于Python 3.x使用:
$ sudo apt-get install python-dev
$ sudo apt-get install python3-dev
$ sudo apt-get install python3.8-dev
对于Python 3.8,请使用:
$ sudo apt-get install python-dev
$ sudo apt-get install python3-dev
$ sudo apt-get install python3.8-dev
你安装了gcc吗?@Dinari:我扩展了我关于
gcc
安装的问题。在完成sudo-apt-install之后——重新安装gcc
它工作了。谢谢你的提示。欢迎回答我的问题。你安装了gcc吗?@Dinari:我扩展了我关于安装gcc
的问题。在完成sudo-apt-install之后——重新安装gcc
它工作了谢谢你的提示。请随便回答我的问题。