Installation error: gcc command not found

I am installing Prodigy on a fresh RHEL (release 7.4) without SUDO privileges (i.e. I cannot install gcc via

sudo yum install “Development Tools”

Thus, I installed the latest Miniconda3 along with:

conda install gxx_linux-64

followed by:

export CC=/app/home/miniconda3/bin/x86_64-conda_cos6-linux-gnu-gcc
export CXX=/app/home/miniconda3/bin/x86_64-conda_cos6-linux-gnu-g++
alias gcc=$CC
alias g++=$CXX
pip install prodigy-1.4.2-cp35.cp36-cp35m.cp36m-linux_x86_64.whl

This results in the following installation errors:

Building wheels for collected packages: ujson, hug, spacy, peewee, murmurhash, cymem, preshed, regex, cytoolz
  Running setup.py bdist_wheel for ujson ... error
  Complete output from command /app/home/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ukqbyklx/ujson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-hxes_2z8 --python-tag cp36:
  running bdist_wheel
  running build
  running build_ext
  building 'ujson' extension
  creating build
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/python
  creating build/temp.linux-x86_64-3.6/lib
  /app/home/miniconda3/bin/x86_64-conda_cos6-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/app/home/miniconda3/include/python3.6m -c ./python/ujson.c -o build/temp.linux-x86_64-3.6/./python/ujson.o -D_GNU_SOURCE
  /app/home/miniconda3/bin/x86_64-conda_cos6-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/app/home/miniconda3/include/python3.6m -c ./python/objToJSON.c -o build/temp.linux-x86_64-3.6/./python/objToJSON.o -D_GNU_SOURCE
  /app/home/miniconda3/bin/x86_64-conda_cos6-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/app/home/miniconda3/include/python3.6m -c ./python/JSONtoObj.c -o build/temp.linux-x86_64-3.6/./python/JSONtoObj.o -D_GNU_SOURCE
  /app/home/miniconda3/bin/x86_64-conda_cos6-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/app/home/miniconda3/include/python3.6m -c ./lib/ultrajsonenc.c -o build/temp.linux-x86_64-3.6/./lib/ultrajsonenc.o -D_GNU_SOURCE
  ./lib/ultrajsonenc.c:156:23: warning: 'g_hexChars' is static but used in inline function 'Buffer_AppendShortHexUnchecked' which is not static
     *(outputOffset++) = g_hexChars[(value & 0x000f) >> 0];
                         ^~~~~~~~~~
  ./lib/ultrajsonenc.c:155:23: warning: 'g_hexChars' is static but used in inline function 'Buffer_AppendShortHexUnchecked' which is not static
     *(outputOffset++) = g_hexChars[(value & 0x00f0) >> 4];
                         ^~~~~~~~~~
  ./lib/ultrajsonenc.c:154:23: warning: 'g_hexChars' is static but used in inline function 'Buffer_AppendShortHexUnchecked' which is not static
     *(outputOffset++) = g_hexChars[(value & 0x0f00) >> 8];
                         ^~~~~~~~~~
  ./lib/ultrajsonenc.c:153:23: warning: 'g_hexChars' is static but used in inline function 'Buffer_AppendShortHexUnchecked' which is not static
     *(outputOffset++) = g_hexChars[(value & 0xf000) >> 12];
                         ^~~~~~~~~~
  /app/home/miniconda3/bin/x86_64-conda_cos6-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./python -I./lib -I/app/home/miniconda3/include/python3.6m -c ./lib/ultrajsondec.c -o build/temp.linux-x86_64-3.6/./lib/ultrajsondec.o -D_GNU_SOURCE
  creating build/lib.linux-x86_64-3.6
  gcc -pthread -shared -B /app/home/miniconda3/compiler_compat -L/app/home/miniconda3/lib -Wl,-rpath=/app/home/miniconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/./python/ujson.o build/temp.linux-x86_64-3.6/./python/objToJSON.o build/temp.linux-x86_64-3.6/./python/JSONtoObj.o build/temp.linux-x86_64-3.6/./lib/ultrajsonenc.o build/temp.linux-x86_64-3.6/./lib/ultrajsondec.o -o build/lib.linux-x86_64-3.6/ujson.cpython-36m-x86_64-linux-gnu.so
  unable to execute 'gcc': No such file or directory
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for ujson
  Running setup.py clean for ujson

So, in some places it picks up gcc from the right alias and then, where it fails, it can’t seem to find the alias to gcc. This is very perplexing as wheels are new to me.

UPDATE

Turns out, all that was necessary (after installing gxx_linux-64 with conda) was:

source activate root  
pip install prodigy-1.4.2-cp35.cp36-cp35m.cp36m-linux_x86_64.whl

The former command sets up all of the necessary environment variables (see conda docs) and then the wheel installation executed with any problems!

Thanks for updating with your solution – glad to hear you got it working! :+1:

1 Like