2016-08-04 82 views
2

Mein docker container verwendet centos6.6. Es kann nicht pip installieren pymssql:pip install pymssql von innen docker container

Step 15 : RUN pip install pymssql 
---> Running in c6a17c43790d 
Collecting pymssql 
    Downloading http://piprepo-au/piprepo/pymssql/pymssql-2.1.1.zip (2.3MB) 
Installing collected packages: pymssql 
    Running setup.py install for pymssql: started 
    Running setup.py install for pymssql: finished with status 'error' 
    Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6Tr3gO/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-DZY29I-record/install-record.txt --single-version-externally-managed --compile: 
setup.py: platform.system() => 'Linux' 
setup.py: platform.architecture() => ('64bit', '') 
setup.py: platform.linux_distribution() => ('CentOS', '6.6', 'Final') 
setup.py: platform.libc_ver() => ('glibc', '2.3') 
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 
cythoning _mssql.pyx to _mssql.c 

Error compiling Cython file: 
------------------------------------------------------------ 
... 
      return uuid.UUID(bytes_le=(<char *>data)[:length]) 

     else: 
      return (<char *>data)[:length] 

    cdef int convert_python_value(self, object value, BYTE **dbValue, 
     ^
------------------------------------------------------------ 

_mssql.pyx:821:9: Signature not compatible with previous declaration 

Error compiling Cython file: 
------------------------------------------------------------ 
... 
    cdef object msghandler 

    cpdef cancel(self) 
    cdef void clear_metadata(self) 
    cdef object convert_db_value(self, BYTE *, int, int) 
    cdef int convert_python_value(self, object value, BYTE **, int*, int*) except -1 

Hat jemand irgendwelche Ideen? Ich habe ziemlich viele Dinge ausprobiert. Ich hatte dieses Problem auf Ubuntu16 nicht.

. . .

+0

Ill überprüfen Sie die Kernel-Version aber Ich wäre sehr überrascht, wenn es nicht 3.10+ wäre. –

+0

Das ist vielleicht eine blöde Frage, aber soll ich die Kernel-Version im Docker-Container überprüfen? –

+0

Entschuldigung - überprüfen Sie die Spezifikationen auf dem Docker-Host, um sicherzustellen, dass der Speichertreiber und andere Systeme mit Ihrem Build kompatibel sind. Die Kernel-Version wird innen und außen gleich sein - weil es _ist_ das gleiche :) – ldg

Antwort

0

Es scheint, dass dies durch einen Schnittstellenwechsel zwischen den Versionen 2.1.1 und 2.1.3 von pymssql verursacht wird. Ich habe keine Zeit, den genauen Grund zu untersuchen, aber nachdem ich das Problem bestehen auf einem centos 7.x Docker Bild zu bemerken konnte ich dieses Problem lösen, indem eine neuere Version von pymssql installieren:

pip install pymssql==2.1.3