1
votes

On Ubuntu 14.04, I use Pycharm Professional Edition. When I start a debug session, I see the following message in the event log of Pycharm:

Python Debugger Extension Available

Cython extension speeds up Python debugging

Install How does it work

Clicking on Install leads to a popup window with an error message:

error message

I depict here the text, too, so that it can be found by others more easily:

Compile Cython Extensions Error

Non-zero exit code (1):

unable to execute 'gcc': No such file or directory

error: command 'gcc' failed with exit status 1

To look for a solution:

  1. I compiled Cython speedups manually according to the link mentioned above: /usr/bin/python3 /<PYCHARM_INSTALLATION_PATH>/helpers/pydev/setup_cython.py build_ext --inplace. This finishes successfully, but does not help with the error message.

  2. I added the python-3.6-dev repository: sudo add-apt-repository ppa:deadsnakes/ppa, executed: sudo apt-get update && sudo apt-get dist-upgrade and installed python-3.6-dev: sudo apt-get install python3.6-dev

    It finishes successfully, but does not change the above popup error message.

What else can I check or execute?

EDIT regarding the installation of gcc, it looks like the following:

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
2
Do you have gcc installed? - Dinari
@Dinari : I extended my question regarding the installation of gcc. - user7468395
and after doing sudo apt install --reinstall gcc it works - user7468395
Thanks for your good hint. Feel free to answer my question. - user7468395

2 Answers

2
votes

For future reference: Cython uses gcc (by default), need to verify it is installed and working properly.
As it installed by default on most recent Ubuntu distributions, if it is not working well, you can follow OP fix and use sudo apt install --reinstall gcc

2
votes

At first:

sudo apt install --reinstall gcc

Then run commands below depends on version of Python , you are using:

For Python 2.x use:

$ sudo apt-get install python-dev

For Python 3.x use:

$ sudo apt-get install python3-dev

For Python 3.8 use:

$ sudo apt-get install python3.8-dev