1

when i try to install it occurs error.What is the solution for that.I am trying from last week onwards,the error is

    sudo pip install pyodbc
Collecting pyodbc
  Downloading pyodbc-4.0.0.tar.gz (190kB)
    100% |████████████████████████████████| 194kB 1.0MB/s 
Installing collected packages: pyodbc
  Running setup.py install for pyodbc ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9dU6Pj/pyodbc/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-K98DR9-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    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 -DPYODBC_VERSION=4.0.0 -DPYODBC_UNICODE_WIDTH=4 -DSQL_WCHART_CONVERT=1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/usr/include/python2.7 -c src/pyodbccompat.cpp -o build/temp.linux-x86_64-2.7/src/pyodbccompat.o -Wno-write-strings
    x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
bob marti
  • 1,523
  • 3
  • 11
  • 27
  • A little bit of Googling would have found you this: http://stackoverflow.com/a/28138922/5110035 Also what have you tried doing? – MichaelMMeskhi Jan 10 '17 at 09:17
  • no need change gcc version. – bob marti Jan 10 '17 at 09:42
  • @MichaelMMeskhi thanks for ur answer.first i thought the same it thing may be it is the problem of gcc.and i go through stackoverflow.com/a/28138922/5110035 this site.finally i understood this is not the problem.and after a continous search i got the answer and its given below – bob marti Jan 10 '17 at 09:45
  • No problem. Glad you solved it :) – MichaelMMeskhi Jan 10 '17 at 09:46

1 Answers1

0

Try this:

sudo apt-get install python-pyodbc

Its worked for me

bob marti
  • 1,523
  • 3
  • 11
  • 27