2016-11-07 2 views
0

pyodbc 설치 시도 중 : pip install pyodbc 다음 오류가 발생했습니다. 특별히 peewee 다른 항목을 설치하고 오류없이 설치합니다. 나는 pip install pymssql으로 더 시도해 보았으며 비슷한 오류가 발생했습니다. 나는 pyodbc에 익숙하며 내 플라스크 응용 프로그램에서 사용하고 싶습니다.pip 설치시 UnicodeDecodeerror

이 오류를 극복 할 수있는 방법을 알고 있다면 누구나 가능합니다.

이어서 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 13: ordinal not in range(128), How to fix: "UnicodeDecodeError: 'ascii' codec can't decode byte"을 추적했지만 문제를 해결할 수 없습니다.

우분투 14.05를 사용하고 있습니다.

pip install pyodbc 
Downloading/unpacking pyodbc 
    Downloading pyodbc-3.0.10.tar.gz (68kB): 68kB downloaded 
    Running setup.py (path:/tmp/pip-build-xNSuOb/pyodbc/setup.py) egg_info for package pyodbc 

warning: no files found matching 'tests/*' 
warning: no files found matching 'README.rst' 
Installing collected packages: pyodbc 
    Running setup.py install for pyodbc 
    building 'pyodbc' 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 - DPYODBC_VERSION=3.0.10 -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 /tmp/pip-build-xNSuOb/pyodbc/src/params.cpp -o build/temp.linux-x86_64-2.7/tmp/pip-build-xNSuOb/pyodbc/src/params.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 
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-xNSuOb/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-GvPtxS-record/install-record.txt --single-version-externally-managed --compile --user: 
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/tmp 

creating build/temp.linux-x86_64-2.7/tmp/pip-build-xNSuOb 

creating build/temp.linux-x86_64-2.7/tmp/pip-build-xNSuOb/pyodbc 

creating build/temp.linux-x86_64-2.7/tmp/pip-build-xNSuOb/pyodbc/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=3.0.10 - 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 /tmp/pip-build-xNSuOb/pyodbc/src/params.cpp -o build/temp.linux-x86_64-2.7/tmp/pip-build-xNSuOb/pyodbc/src/params.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 

---------------------------------------- 
Cleaning up... 
Command /usr/bin/python -c "import setuptools,  tokenize;__file__='/tmp/pip-build- xNSuOb/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open) (__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install -- record /tmp/pip-GvPtxS-record/install-record.txt --single-version- externally-managed --compile --user failed with error code 1 in /tmp/pip- build-xNSuOb/pyodbc 
Traceback (most recent call last): 
    File "/usr/bin/pip", line 9, in <module> 
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() 
    File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 248,  in main 
    return command.main(cmd_args) 
    File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line  161, in main 
    text = '\n'.join(complete_log) 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 66: ordinal not in range(128) 
+0

사용중인 gcc의 버전은 무엇입니까? –

+0

'sav @ sav-systems : ~/github $ gcc --version' 'gcc (우분투 4.8.4-2ubuntu1 ~ 14.04.3) 4.8.4' – saviour123

답변

0

감사합니다. 한 가닥 페이지의 친구가 도와줍니다.

  1. export LC_ALL=C 이렇게하면 운영 체제에서 로컬 구성을 사용하게됩니다.
  2. 다시
  3. pip install pyodbcpip install --upgrade setuptools하고이 오류 그러나 더 이상 ascii 문제 다음
  4. 우리는 다음 pyodbc는 C로 작성 이후 GCC 컴파일러와 함께 두 번째 문제를 파악

fatal error: sql.h: No such file or directory #include <sql.h> ^compilation terminated.error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

그리고이 마침내 그것을

,369 해결

4.run sudo apt-get install unixodbc-dev && sudo apt-get install pyodbc

답변 해 주셔서 감사합니다.

0

대개 문제는 고대 파이프를 사용하는 것입니다 - 1.5.6. pip install -U pip으로 최신 버전으로 업그레이드하고 다시 확인하십시오.

또한 python-devel이 설치되어 있는지 확인하십시오.

+0

감사합니다. – saviour123