아래와 같은 에러 발생 시

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# pip install --upgrade pyodbc
Collecting pyodbc
  Using cached pyodbc-4.0.22.tar.gz
Building wheels for collected packages: pyodbc
  Running setup.py bdist_wheel for pyodbc ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uy211_p4/pyodbc/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/tmpun36g10hpip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_ext
  building 'pyodbc' extension
  creating build
  creating build/temp.linux-x86_64-3.4
  creating build/temp.linux-x86_64-3.4/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPYODBC_VERSION=4.0.22 -I/usr/include/python3.4m -c src/errors.cpp -o build/temp.linux-x86_64-3.4/src/errors.o -Wno-write-strings
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
  In file included from src/errors.cpp:2:0:
  src/pyodbc.h:56:17: 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
 
  ----------------------------------------
  Failed building wheel for pyodbc
  Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc
  Running setup.py install for pyodbc ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uy211_p4/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-2segjg5z-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-3.4
    creating build/temp.linux-x86_64-3.4/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPYODBC_VERSION=4.0.22 -I/usr/include/python3.4m -c src/errors.cpp -o build/temp.linux-x86_64-3.4/src/errors.o -Wno-write-strings
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
    In file included from src/errors.cpp:2:0:
    src/pyodbc.h:56:17: 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
 
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uy211_p4/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-2segjg5z-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-uy211_p4/pyodbc/
 
cs



의존성과 관련하여 다른 프로그램을 사전 설치할 필요가 있습니다.


1. python-pip 를 설치합니다.

 : apt-get install unixodbc-dev

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# apt-get install unixodbc-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libltdl-dev libodbc1 libtool odbcinst odbcinst1debian2 unixodbc
Suggested packages:
  libtool-doc libmyodbc odbc-postgresql tdsodbc unixodbc-bin gcj-jdk
The following NEW packages will be installed:
  libltdl-dev libodbc1 libtool odbcinst odbcinst1debian2 unixodbc unixodbc-dev
0 upgraded, 7 newly installed, 0 to remove and 2 not upgraded.
Need to get 804 kB of archives.
After this operation, 5,198 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libodbc1 amd64 2.2.14p2-5ubuntu5 [175 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main odbcinst amd64 2.2.14p2-5ubuntu5 [12.6 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main odbcinst1debian2 amd64 2.2.14p2-5ubuntu5 [40.6 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main libltdl-dev amd64 2.4.2-1.7ubuntu1 [157 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main libtool amd64 2.4.2-1.7ubuntu1 [188 kB]
Get:6 http://archive.ubuntu.com/ubuntu/ trusty/main unixodbc amd64 2.2.14p2-5ubuntu5 [19.8 kB]
Get:7 http://archive.ubuntu.com/ubuntu/ trusty/main unixodbc-dev amd64 2.2.14p2-5ubuntu5 [211 kB]
Fetched 804 kB in 4s (188 kB/s)
Selecting previously unselected package libodbc1:amd64.
(Reading database ... 55073 files and directories currently installed.)
Preparing to unpack .../libodbc1_2.2.14p2-5ubuntu5_amd64.deb ...
Unpacking libodbc1:amd64 (2.2.14p2-5ubuntu5) ...
Selecting previously unselected package odbcinst.
Preparing to unpack .../odbcinst_2.2.14p2-5ubuntu5_amd64.deb ...
Unpacking odbcinst (2.2.14p2-5ubuntu5) ...
Selecting previously unselected package odbcinst1debian2:amd64.
Preparing to unpack .../odbcinst1debian2_2.2.14p2-5ubuntu5_amd64.deb ...
Unpacking odbcinst1debian2:amd64 (2.2.14p2-5ubuntu5) ...
Selecting previously unselected package libltdl-dev:amd64.
Preparing to unpack .../libltdl-dev_2.4.2-1.7ubuntu1_amd64.deb ...
Unpacking libltdl-dev:amd64 (2.4.2-1.7ubuntu1) ...
Selecting previously unselected package libtool.
Preparing to unpack .../libtool_2.4.2-1.7ubuntu1_amd64.deb ...
Unpacking libtool (2.4.2-1.7ubuntu1) ...
Selecting previously unselected package unixodbc.
Preparing to unpack .../unixodbc_2.2.14p2-5ubuntu5_amd64.deb ...
Unpacking unixodbc (2.2.14p2-5ubuntu5) ...
Selecting previously unselected package unixodbc-dev.
Preparing to unpack .../unixodbc-dev_2.2.14p2-5ubuntu5_amd64.deb ...
Unpacking unixodbc-dev (2.2.14p2-5ubuntu5) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up libodbc1:amd64 (2.2.14p2-5ubuntu5) ...
Setting up libltdl-dev:amd64 (2.4.2-1.7ubuntu1) ...
Setting up libtool (2.4.2-1.7ubuntu1) ...
Setting up odbcinst1debian2:amd64 (2.2.14p2-5ubuntu5) ...
Setting up unixodbc (2.2.14p2-5ubuntu5) ...
Setting up unixodbc-dev (2.2.14p2-5ubuntu5) ...
Setting up odbcinst (2.2.14p2-5ubuntu5) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
 
cs


2. python-pip 를 설치합니다.

 : apt-get install python-pip

1
2
3
4
5
6
7
# apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
 
cs



3. 다시 pyodbc 설치를 진행합니다.

 : pip install pyodbc

1
2
3
4
5
6
7
8
9
10
# pip install pyodbc
Collecting pyodbc
  Using cached pyodbc-4.0.22.tar.gz
Building wheels for collected packages: pyodbc
  Running setup.py bdist_wheel for pyodbc ... done
  Stored in directory: /root/.cache/pip/wheels/4f/ca/76/a2d9249e460278808e73f834a0312bb9747bb5b8800670cf80
Successfully built pyodbc
Installing collected packages: pyodbc
Successfully installed pyodbc-4.0.22
 
cs



+ Recent posts