2016-12-08 7 views
0

Ich versuche Python mit meiner Oracle-Datenbank mit dem Modul cx_Oracle zu verbinden. Ich habe versucht, es für die letzten paar Stunden zu installieren und finde keine Antwort auf mein Problem.Mac OSX Sierra Python 3.5.2 Installation von cx_oracle fehlgeschlagen

Bei der Installation cx_Oracle mit: pip install cx_oracle

Collecting cx_oracle 
    Using cached cx_Oracle-5.2.1.tar.gz 
Building wheels for collected packages: cx-oracle 
    Running setup.py bdist_wheel for cx-oracle ... error 
    Complete output from command /Users/dunker/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/x2/shhmzq692yx16cmgnmm8wgqm0000gn/T/pip-build-u1fc6kgz/cx-oracle/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 /var/folders/x2/shhmzq692yx16cmgnmm8wgqm0000gn/T/tmpdol0yxgqpip-wheel- --python-tag cp35: 
    running bdist_wheel 
    running build 
    running build_ext 
    building 'cx_Oracle' extension 
    creating build 
    creating build/temp.macosx-10.6-x86_64-3.5-12c 
    /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dunker/anaconda3/include -arch x86_64 -I/Library/Oracle/instantclient_11_2/sdk/include -I/Users/dunker/anaconda3/include/python3.5m -c cx_Oracle.c -o build/temp.macosx-10.6-x86_64-3.5-12c/cx_Oracle.o -DBUILD_VERSION=5.2.1 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:761: 
    In file included from ./Cursor.c:246: 
    In file included from ./Variable.c:171: 
    ./NumberVar.c:372:26: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value] 
     length = numDigits + abs(scale) + 3; 
         ^
    ./NumberVar.c:372:26: note: use function 'labs' instead 
     length = numDigits + abs(scale) + 3; 
          ^~~ 
          labs 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:761: 
    In file included from ./Cursor.c:246: 
    In file included from ./Variable.c:176: 
    ./ObjectVar.c:118:19: warning: comparison of integers of different signs: 'int' and 'ub4' (aka 'unsigned int') [-Wsign-compare] 
     for (i = 0; i < self->allocatedElements; i++) { 
        ~^~~~~~~~~~~~~~~~~~~~~~~~ 
    ./ObjectVar.c:135:19: warning: comparison of integers of different signs: 'int' and 'ub4' (aka 'unsigned int') [-Wsign-compare] 
     for (i = 0; i < self->allocatedElements; i++) { 
        ~^~~~~~~~~~~~~~~~~~~~~~~~ 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:761: 
    In file included from ./Cursor.c:246: 
    ./Variable.c:926:32: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'int' [-Wsign-compare] 
     if (var->allocatedElements < cursor->fetchArraySize) { 
      ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:761: 
    ./Cursor.c:2440:19: warning: comparison of integers of different signs: 'int' and 'ub4' (aka 'unsigned int') [-Wsign-compare] 
     for (i = 0; i < rowCountArraySize; i++) { 
        ~^~~~~~~~~~~~~~~~~~ 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:764: 
    ./Subscription.c:451:19: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'sb4' (aka 'int') [-Wsign-compare] 
     for (i = 0; i < numRows; i++) { 
        ~^~~~~~~~ 
    ./Subscription.c:526:19: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'sb4' (aka 'int') [-Wsign-compare] 
     for (i = 0; i < numTables; i++) { 
        ~^~~~~~~~~~ 
    ./Subscription.c:618:23: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'sb4' (aka 'int') [-Wsign-compare] 
      for (i = 0; i < numTables; i++) { 
         ~^~~~~~~~~~ 
    ./Subscription.c:660:23: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'sb4' (aka 'int') [-Wsign-compare] 
      for (i = 0; i < numQueries; i++) { 
         ~^~~~~~~~~~~ 
    **9 warnings generated.** 
    creating build/lib.macosx-10.6-x86_64-3.5-12c 
    /usr/bin/clang -bundle -undefined dynamic_lookup -L/Users/dunker/anaconda3/lib -arch x86_64 build/temp.macosx-10.6-x86_64-3.5-12c/cx_Oracle.o -L/Library/Oracle/instantclient_11_2 -L/Users/dunker/anaconda3/lib -lclntsh -o build/lib.macosx-10.6-x86_64-3.5-12c/cx_Oracle.cpython-35m-darwin.so -shared-libgcc 
    ld: library not found for -lclntsh 
    clang: error: linker command failed with exit code 1 (use -v to see invocation) 
    error: command '/usr/bin/clang' failed with exit status 1 

    ---------------------------------------- 
    Failed building wheel for cx-oracle 
    Running setup.py clean for cx-oracle 
Failed to build cx-oracle 
Installing collected packages: cx-oracle 
    Running setup.py install for cx-oracle ... error 
    Complete output from command /Users/dunker/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/x2/shhmzq692yx16cmgnmm8wgqm0000gn/T/pip-build-u1fc6kgz/cx-oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/x2/shhmzq692yx16cmgnmm8wgqm0000gn/T/pip-jk8j3nz6-record/install-record.txt --single-version-externally-managed --compile: 
    running install 
    running build 
    running build_ext 
    building 'cx_Oracle' extension 
    creating build 
    creating build/temp.macosx-10.6-x86_64-3.5-12c 
    /usr/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dunker/anaconda3/include -arch x86_64 -I/Library/Oracle/instantclient_11_2/sdk/include -I/Users/dunker/anaconda3/include/python3.5m -c cx_Oracle.c -o build/temp.macosx-10.6-x86_64-3.5-12c/cx_Oracle.o -DBUILD_VERSION=5.2.1 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:761: 
    In file included from ./Cursor.c:246: 
    In file included from ./Variable.c:171: 
    ./NumberVar.c:372:26: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value] 
     length = numDigits + abs(scale) + 3; 
          ^
    ./NumberVar.c:372:26: note: use function 'labs' instead 
     length = numDigits + abs(scale) + 3; 
          ^~~ 
          labs 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:761: 
    In file included from ./Cursor.c:246: 
    In file included from ./Variable.c:176: 
    ./ObjectVar.c:118:19: warning: comparison of integers of different signs: 'int' and 'ub4' (aka 'unsigned int') [-Wsign-compare] 
     for (i = 0; i < self->allocatedElements; i++) { 
        ~^~~~~~~~~~~~~~~~~~~~~~~~ 
    ./ObjectVar.c:135:19: warning: comparison of integers of different signs: 'int' and 'ub4' (aka 'unsigned int') [-Wsign-compare] 
     for (i = 0; i < self->allocatedElements; i++) { 
        ~^~~~~~~~~~~~~~~~~~~~~~~~ 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:761: 
    In file included from ./Cursor.c:246: 
    ./Variable.c:926:32: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'int' [-Wsign-compare] 
     if (var->allocatedElements < cursor->fetchArraySize) { 
      ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:761: 
    ./Cursor.c:2440:19: warning: comparison of integers of different signs: 'int' and 'ub4' (aka 'unsigned int') [-Wsign-compare] 
     for (i = 0; i < rowCountArraySize; i++) { 
        ~^~~~~~~~~~~~~~~~~~ 
    In file included from cx_Oracle.c:203: 
    In file included from ./SessionPool.c:138: 
    In file included from ./Connection.c:764: 
    ./Subscription.c:451:19: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'sb4' (aka 'int') [-Wsign-compare] 
     for (i = 0; i < numRows; i++) { 
        ~^~~~~~~~ 
    ./Subscription.c:526:19: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'sb4' (aka 'int') [-Wsign-compare] 
     for (i = 0; i < numTables; i++) { 
        ~^~~~~~~~~~ 
    ./Subscription.c:618:23: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'sb4' (aka 'int') [-Wsign-compare] 
      for (i = 0; i < numTables; i++) { 
         ~^~~~~~~~~~ 
    ./Subscription.c:660:23: warning: comparison of integers of different signs: 'ub4' (aka 'unsigned int') and 'sb4' (aka 'int') [-Wsign-compare] 
      for (i = 0; i < numQueries; i++) { 
         ~^~~~~~~~~~~ 
    9 warnings generated. 
    creating build/lib.macosx-10.6-x86_64-3.5-12c 
    /usr/bin/clang -bundle -undefined dynamic_lookup -L/Users/dunker/anaconda3/lib -arch x86_64 build/temp.macosx-10.6-x86_64-3.5-12c/cx_Oracle.o -L/Library/Oracle/instantclient_11_2 -L/Users/dunker/anaconda3/lib -lclntsh -o build/lib.macosx-10.6-x86_64-3.5-12c/cx_Oracle.cpython-35m-darwin.so -shared-libgcc 
    ld: library not found for -lclntsh 
    clang: error: linker command failed with exit code 1 (use -v to see invocation) 
    error: command '/usr/bin/clang' failed with exit status 1 

ich diese Art der Fehlermeldung. Ich folgte mehr als 10 Tutorials, aber ich finde keine Antwort. Setze die env Variablen richtig und alles andere funktioniert.

+1

Sicher werde ich. Das tut mir leid. – dummker

+0

Keine Sorge, und danke! – halfer

Antwort

1

Ok, so fand ich den Fehler:

Gehen Sie zu Ihrem $ORACLE_HOME in meinem Fall war es/library/oracle/instantclient_11_2

ln -s libclntsh.dylib.12.1 libclntsh.dylib 

und dann

pip install --no-cache-dir --allow-external --allow-unverified cx_oracle 

für mich gearbeitet out .

Verwandte Themen