1

I am trying to install pymssql

pip install pymssql

for Python 2.7 on a Debian 8 machine, however it keeps failing on me.

I have already installed the following dependencies after running apt-get update and apt-get upgrade:

  • freetds-dev
  • freetds-bin
  • python-dev
  • python-pip

I am getting the following error:

Downloading/unpacking pymssql
  Downloading pymssql-2.1.3.tar.gz (897kB): 897kB downloaded
  Running setup.py (path:/tmp/pip-build-e7ebv1/pymssql/setup.py) egg_info  for package pymssql
    setup.py: platform.system() => 'Linux'
    setup.py: platform.architecture() => ('64bit', 'ELF')
    setup.py: platform.linux_distribution() => ('debian', '8.5', '')
    setup.py: platform.libc_ver() => ('glibc', '2.4')
    setup.py: Not using bundled FreeTDS
    setup.py: include_dirs = ['/usr/local/include']
    setup.py: library_dirs = ['/usr/local/lib']

    Installed /tmp/pip-build-e7ebv1/pymssql/setuptools_git-1.1-py2.7.egg

Installing collected packages: pymssql
  Running setup.py install for pymssql
    setup.py: platform.system() => 'Linux'
    setup.py: platform.architecture() => ('64bit', 'ELF')
    setup.py: platform.linux_distribution() => ('debian', '8.5', '')
    setup.py: platform.libc_ver() => ('glibc', '2.4')
    setup.py: Not using bundled FreeTDS
    setup.py: include_dirs = ['/usr/local/include']
    setup.py: library_dirs = ['/usr/local/lib']
    building '_mssql' extension
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB
    x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-e7ebv1/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-k9mYEi-record/install-record.txt --single-version-externally-managed --compile:
    setup.py: platform.system() => 'Linux'

setup.py: platform.architecture() => ('64bit', 'ELF')

setup.py: platform.linux_distribution() => ('debian', '8.5', '')

setup.py: platform.libc_ver() => ('glibc', '2.4')

setup.py: Not using bundled FreeTDS

setup.py: include_dirs = ['/usr/local/include']

setup.py: library_dirs = ['/usr/local/lib']

running install

running build

running build_ext

building '_mssql' extension

creating build

creating build/temp.linux-x86_64-2.7

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB

x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)

Please submit a full bug report,

with preprocessed source if appropriate.

See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 4

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-e7ebv1/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-k9mYEi-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-e7ebv1/pymssql
Storing debug log for failure in /root/.pip/pip.log

The error seems to be originating from directories that are perhaps assumed to be following this order: (from the same error)

setup.py: include_dirs = ['/usr/local/include']
setup.py: library_dirs = ['/usr/local/lib']

In order to get rid of this error and successfuly install pymssql, do I have to install/update the program that terminated and showed this error? (which is, am assuming: x86_64-linux-gnu-gcc) or are there other dependencies I am not aware of ?

martineau
  • 119,623
  • 25
  • 170
  • 301
ali
  • 13
  • 1
  • 7
  • Does your computer / virtual machine have enough memory? See for example [answer](http://stackoverflow.com/a/25916353/5781248). Error message "x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)" is the most relevant part of that error message. – J.J. Hakala Aug 05 '16 at 15:44
  • 1
    It was a memory problem indeed. The machine was exhausted by too many zombie processes. I had to kill them using `pkill _processname_ ` . Thanks @martineau – ali Aug 29 '16 at 17:03
  • The thanks for the suggestion about memory should go to @J.J. Hakala, not me — all I did was pretty-up your question... – martineau Aug 29 '16 at 17:44
  • Apologies. I meant to thank @J.J.Hakala – ali Aug 29 '16 at 17:53

1 Answers1

0

If you don't have build-essential installed then install it if that doesn't work try this. Installing lxml with pip in virtualenv Ubuntu 12.10 error: command 'gcc' failed with exit status 4

Community
  • 1
  • 1
  • Solved. Problem in my case was related to memory being almost full. Not related to dependencies. – ali Aug 29 '16 at 17:05