1

I'm just a little frustrated. On my Linux-computer: As a rehearsal for the real work I try to compile a very simple program with cx_Freeze. But first of all I have to install it. I'm using python 3.5. When I type "python pip install cx_Freeze" I get some lines in my terminal and in the end I get an error:

<other lines>
running build_ext
building 'cx_Freeze.util' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/source
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/util.c -o build/temp.linux-x86_64-2.7/source/util.o
source/util.c:6:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

There are a few things I've considered:
- It may be gcc is not installed. If I open the "software manager" and search for "gcc", I can see it is installed. ("GNU C compiler": Green check)
- It seems to be installing for python 2.7 wich I don't want anyway. How to get it to work with 3.5? Can this be why it seems to miss some directory?

Thanks in advance, Jan

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
Cat lover
  • 19
  • 4
  • I installed it for both python-versions. My program should work for both versions. Just to see if this solves it... – Cat lover Dec 16 '18 at 20:24
  • /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ------------ Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e3ZQ6M/cx-Freeze/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-IKNnjS/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-e3ZQ6M/cx-Freeze/ – Cat lover Dec 16 '18 at 20:28
  • The "python.h"-part is gone but it still doesn't work. :( – Cat lover Dec 16 '18 at 20:29
  • .. So I guess I run into the next problem. – Cat lover Dec 19 '18 at 11:14

0 Answers0