jiaoz / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Can't install pyodbc - sqltypes.h error: "SQLBIGINT" does not name a type #274

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.sudo pip install pyodbc 

What is the expected output? What do you see instead?
trying to install pyodbc outputs this:
/usr/bin/pip run on Sat Jun 30 19:06:52 2012
Downloading/unpacking pyodbc
  Running setup.py egg_info for package pyodbc
    running egg_info
    writing pip-egg-info/pyodbc.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/pyodbc.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/pyodbc.egg-info/dependency_links.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/pyodbc.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'tests/*'
    writing manifest file 'pip-egg-info/pyodbc.egg-info/SOURCES.txt'
Installing collected packages: pyodbc
  Running setup.py install for pyodbc
    Running command /usr/bin/python -c "import setuptools;__file__='/home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-fnhO7e-record/install-record.txt
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPYODBC_VERSION=3.0.6 -I/usr/include/python2.7 -c /home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/src/pyodbcdbg.cpp -o build/temp.linux-i686-2.7/home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/src/pyodbcdbg.o -Wno-write-strings
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
    In file included from /usr/local/include/sql.h:19:0,
                     from /home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/src/pyodbc.h:48,
                     from /home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/src/pyodbcdbg.cpp:2:
    /usr/local/include/sqltypes.h:400:19: error: ‘SQLBIGINT’ does not name a type
    /usr/local/include/sqltypes.h:403:20: error: ‘SQLUBIGINT’ does not name a type
    error: command 'gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-fnhO7e-record/install-record.txt:
    running install

running build

running build_ext

building 'pyodbc' extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -fPIC -DPYODBC_VERSION=3.0.6 -I/usr/include/python2.7 -c 
/home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/src/pyodbcdbg.cpp -o 
build/temp.linux-i686-2.7/home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/src/pyodb
cdbg.o -Wno-write-strings

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for 
Ada/C/ObjC but not for C++ [enabled by default]

In file included from /usr/local/include/sql.h:19:0,

                 from /home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/src/pyodbc.h:48,

                 from /home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/src/pyodbcdbg.cpp:2:

/usr/local/include/sqltypes.h:400:19: error: ‘SQLBIGINT’ does not name a 
type

/usr/local/include/sqltypes.h:403:20: error: ‘SQLUBIGINT’ does not name a 
type

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /usr/bin/python -c "import 
setuptools;__file__='/home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/setup.py';exe
c(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
install --single-version-externally-managed --record 
/tmp/pip-fnhO7e-record/install-record.txt failed with error code 1
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 228, in run
    requirement_set.install(install_options, global_options)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1093, in install
    requirement.install(install_options, global_options)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 566, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 255, in call_subprocess
    % (command_desc, proc.returncode))
InstallationError: Command /usr/bin/python -c "import 
setuptools;__file__='/home/gfeadmin/temp/pyodbc-3.0.6/build/pyodbc/setup.py';exe
c(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
install --single-version-externally-managed --record 
/tmp/pip-fnhO7e-record/install-record.txt failed with error code 1

What version of the product are you using? On what operating system?
ubuntu-server 12.04 LTS
python 2.7
unixodbc 2.2.14

Original issue reported on code.google.com by mjsrs....@gmail.com on 1 Jul 2012 at 2:17

GoogleCodeExporter commented 8 years ago
It appears that you've hit a bug in unixODBC that was fixed in 2.2.14p2-2.  I'm 
not sure what p2-2 means, but I would guess some kind of patch to 2.2.14.

Is it possible to update unixodbc?

I'm going to mark this as closed here because I'm 99.99% sure the bug is in 
unixodbc.  If not, feel free to reopen.  Sorry I couldn't do more.

BTW, if you are comfortable doing so, I would imagine the issue is a simple 
header file update.  It shouldn't be hard to manually patch your unixodbc 
headers from p2-2 to complete the build.  (Not something you'd want to do 
often, but if you are just setting up a test environment or something, it 
should work.)

Original comment by mkleehammer on 1 Jul 2012 at 3:43

GoogleCodeExporter commented 8 years ago
I forgot to include the link to the bug report: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582591

This is why I believe the issue is in unixODBC.

Original comment by mkleehammer on 1 Jul 2012 at 3:44