3

I'm writing a simple example to test Cython:

helloworld.pyx

def foo():
    print "hello cython world"

test_cython.py

import pyximport
pyximport.install()
import helloworld
helloworld.foo()

Which then returns:

ImportError: Building module testy failed:
["CompileError: command '/BAD_PATH/gcc' failed with exit status 1\n"]

The error had to do with Cython using a bad path to gcc.

Using "which gcc", I see my machine holds it in:

/CORRECT_PATH/gcc

Given I can't move gcc's location or write symlinks, are there any options in Cython to force it to use a different gcc location?

Roy Iacob
  • 412
  • 3
  • 13
  • 2
    I'm not 100% sure (otherwise I'd post this as an answer...) but I think pyximport uses [distutils' setup.cfg](https://docs.python.org/3/distutils/configfile.html) which you can specify a compiler in. I'd also check to see if you have any `CC` environmental variables set which are overriding the compiler. – DavidW Apr 28 '17 at 07:29

0 Answers0