Closed j-mon closed 1 year ago
@j-mon, The problem you are pointing for python 3.11 and the error mentioned here is for python 3.9. Can you please share the complete output of "pip install ibm_db".
Warning: If you use the ARM version of homebrew (as recommended for M1 architectures) you will get the following error message:
$ brew install gcc-12
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
brew bundle dump
Install gcc@12
using homebrew (note: the x86_64 version of homebrew is needed for this, not the recommended ARM based homebrew)
. The clearest instructions on how to install and use the x86_64
version of homebrew
is by following below steps:
$ which brew
/opt/homebrew/bin/brew
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# brew hack for x86_64
alias brew64='arch -x86_64 /usr/local/bin/brew'
brew64 install gcc@12
arch -x86_64 /bin/bash or arch -x86_64 /bin/zsh
.gcc -v
command. It should show Target: x86_64-apple-darwin21
in output.python --version
, which python
and file/usr/local/bin/python
commands. It should show /usr/local/bin/python: Mach-O 64-bit executable x86_64
site_packages
directory. Check output of python -m site
command.~/.zshrc
or ~/.bashrc
file based on your shell with below lines:
export DYLD_LIBRARY_PATH=/usr/local/lib/gcc/12:{ABSOLUTE PATH TO site_packages}/clidriver/lib:$DYLD_LIBRARY_PATH
export PATH={ABSOLUTE PATH TO site_packages}/clidriver/bin:$PATH
gcc -v => Output should have x86_64
python --version or python3 --version
file `which python` or file `which python3` => Output should have x86_64
pip uninstall ibm_db
pip install ibm_db
run your test program to verify.
/usr/local/Homebrew/Cellar/gcc
. In this case, first find the location of gcc library libstdc++.6.dylib installed in your system and then run below commands to fix the issue:
cd {ABSOLUTE PATH TO site_packages}/clidriver/lib
otool -L libdb2.dylib => note down the path of libstdc++.6.dylib in output.
install_name_tool -change <existing path of libstdc++ in libdb2.dylib> <full path of libstdc++ in your system> libdb2.dylib
f.e.
install_name_tool -change /usr/local/lib/gcc/8/libstdc++.6.dylib /usr/local/Homebrew/Cellar/gcc@12/12.3.0/lib/gcc/12/libstdc++.6.dylib libdb2.dylib
Thanks.
@j-mon I hope you are able to install ibm_db using right steps now. Please let us know if we can close this issue? Thanks.
export ARCHFLAGS="-arch x86_64"
Can we just "update the pypi package" instead of needing a complete separate homebrew/compiling from source workaround? This isn't meeting users where they are at all; in fact, its the complete opposite. Thanks.
@stealthco-tony The latest version of ibm_db do not need compiler as it comes as a precompiled wheel package. But you need x64 version of python to install ibm_db. Thanks.
Hi, I followd the steps and this is the output: ImportError Traceback (most recent call last) Cell In[8], line 1 ----> 1
import ibm_db
ImportError: dlopen(/Users/israelvargas/Documents/IBM Proyectos/MATT/Projects/Finanzas/.venv/lib/python3.9/site-packages/ibm_db.cpython-39-darwin.so, 0x0002): Symbol not found: ZNKSt8detail20_Prime_rehash_policy14_M_need_rehashEmmm Referenced from: <803DFCA0-2956-3B4C-B633-4BCFBAA8B43A> {path_to_local_enviroment}/libdb2.dylib Expected in: <3FE24BF6-7E7F-338E-B009-41FD96FDB569> /usr/lib/libstdc++.6.dylib
Python version: 3.9 gcc -v: x86_64-apple-darwin23.6.0 This is a virtual environment created based on 3.9 Python intel. I think that it is similar to the expected error that you mentioned in the instructions, but I cannot solve it yet. Is there any hint?
It’s impossible to solve it’s a crazy bug let me know how it goes lol
Jeffrey Monsalve
Stevens Institute of Technology | 2022 Rutgers University | 2017 | Mobile: (201)-850-2684 |
http://www.linkedin.com/in/jemonsalve/
On Fri, Sep 6, 2024 at 7:32 PM Israel Vargas @.***> wrote:
Hi, I followd the steps and this is the output: ImportError Traceback (most recent call last) Cell In[8], line 1 ----> 1
import ibm_db
ImportError: dlopen(/Users/israelvargas/Documents/IBM Proyectos/MATT/Projects/Finanzas/.venv/lib/python3.9/site-packages/ ibm_db.cpython-39-darwin.so, 0x0002): Symbol not found: ZNKSt8detail20_Prime_rehash_policy14_M_need_rehashEmmm Referenced from: <803DFCA0-2956-3B4C-B633-4BCFBAA8B43A> {path_to_local_enviroment}/libdb2.dylib Expected in: <3FE24BF6-7E7F-338E-B009-41FD96FDB569> /usr/lib/libstdc++.6.dylib
Python version: 3.9 gcc -v: x86_64-apple-darwin23.6.0 This is a virtual environment created based on 3.9 Python intel. I think that it is similar to the expected error that you mentioned in the instructions, but I cannot solve it yet. Is there any hint?
— Reply to this email directly, view it on GitHub https://github.com/ibmdb/python-ibmdb/issues/835#issuecomment-2334937764, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGKU7SUOCPB7PANOTKUQG3TZVI3QHAVCNFSM6AAAAAAWNQWVFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZUHEZTONZWGQ . You are receiving this because you were mentioned.Message ID: @.***>
I think it’s missing a file in a path ?
Jeffrey Monsalve
Stevens Institute of Technology | 2022 Rutgers University | 2017 | Mobile: (201)-850-2684 |
http://www.linkedin.com/in/jemonsalve/
On Fri, Sep 6, 2024 at 7:33 PM Jeffrey Monsalve @.***> wrote:
It’s impossible to solve it’s a crazy bug let me know how it goes lol
Jeffrey Monsalve
Stevens Institute of Technology | 2022 Rutgers University | 2017 | Mobile: (201)-850-2684 |
http://www.linkedin.com/in/jemonsalve/
On Fri, Sep 6, 2024 at 7:32 PM Israel Vargas @.***> wrote:
Hi, I followd the steps and this is the output: ImportError Traceback (most recent call last) Cell In[8], line 1 ----> 1
import ibm_db
ImportError: dlopen(/Users/israelvargas/Documents/IBM Proyectos/MATT/Projects/Finanzas/.venv/lib/python3.9/site-packages/ ibm_db.cpython-39-darwin.so, 0x0002): Symbol not found: ZNKSt8detail20_Prime_rehash_policy14_M_need_rehashEmmm Referenced from: <803DFCA0-2956-3B4C-B633-4BCFBAA8B43A> {path_to_local_enviroment}/libdb2.dylib Expected in: <3FE24BF6-7E7F-338E-B009-41FD96FDB569> /usr/lib/libstdc++.6.dylib
Python version: 3.9 gcc -v: x86_64-apple-darwin23.6.0 This is a virtual environment created based on 3.9 Python intel. I think that it is similar to the expected error that you mentioned in the instructions, but I cannot solve it yet. Is there any hint?
— Reply to this email directly, view it on GitHub https://github.com/ibmdb/python-ibmdb/issues/835#issuecomment-2334937764, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGKU7SUOCPB7PANOTKUQG3TZVI3QHAVCNFSM6AAAAAAWNQWVFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZUHEZTONZWGQ . You are receiving this because you were mentioned.Message ID: @.***>
@IsraAgus Please share output of below commands to understand your system environment:
otool -L /Users/israelvargas/Documents/IBM Proyectos/MATT/Projects/Finanzas/.venv/lib/python3.9/site-packages/ibm_db.cpython-39-darwin.so
gcc -v => complete output.
echo $DYLD_LIBRARY_PATH
ls /usr/local/Homebrew/Cellar/gcc
Also, check troubleshooting instructions as documented here: https://github.com/ibmdb/python-ibmdb/blob/master/INSTALL.md#-4-troubleshooting-post-install-errors Thanks.
Hello,
It works now for me. As you mentioned @bimalkjha, I committed a mistake when I configured the environment variable for the file: libstdc++.6.dylib. The simplest solution is in the last tutorial you shared in the troubleshooting section: https://github.com/ibmdb/python-ibmdb/blob/master/INSTALL.md#-4-troubleshooting-post-install-errors
It is crucial to mention that when you start the installation and all the stuff, be sure that the zsh prompt is running in the x86 architecture; otherwise, the installation will not work.
For future readers:
Operating System Name:
db2level output from clidriver if in use:
Target Db2 Server Version:
Python Version: 3.11
ibm_db version: ibm_db
For non-Windows, output of below commands: uname: Darwin uname -m: arm64
Value of below environment variables if set: IBM_DB_HOME: PATH: LIB/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH:
Test script to reproduce the problem.
For installation related issue, complete output of
pip install ibm_db
command.Error:
0 3.188 File "/tmp/pip-build-env-nkbtdim_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
0 3.188 exec(code, locals())
0 3.188 File "", line 350, in
0 3.188 NameError: name 'arch_' is not defined
0 3.188 [end of output]
Steps to Reproduce: