![]() ![]() Do try out different themes and let me know what works best for you. To know more do head over to their repo - they have a lot of options and configurations available.Īnd that is all. Z keeps a track of all folders you have cd’ed into, in a file called ~/.z and after you have visited a folder once you can do z folder name to go directly into that. /./workspace you can just do z workspace and voila you are inside that folder. Just keep that in mind incase you are having some diffculties. If it works in the python REPL, then it should work when actually run.Now, everywhere I read, I found that we need to specially source syntax highligthing at the end of the file( /.zshrc) but I did not need to do that and it worked for me. Similar to the Intel instructions, virtual environments help isolate packages between projects Install the x86 compatible version of Python you want.Īrch -x86_64 brew install Make sure you’re using a virtual environment.# Install the x86-compatible version of homebrewĪrch -x86_64 /bin/bash -c "$(curl -fsSL )" You might need to uninstall your current version of homebrew first Reinstall homebrew, but the x86 compatible version of homebrew! The explanation for why this is needed is on the python-ibmdb page.The steps for this are a bit more complicated an very easy to get wrong unfortunately Your results may varyĬonnecting to IBM DB2 on MacOS (M1 / Apple Silicon) with Python Testing with Python 3.9, I don’t have this problem, and don’t need to run this script. Note, I’ve only had this issue when using Python 3.7 and python 3.8. Ln -s "/usr/local/lib/$py_folder/site-packages/clidriver/lib/libdb2.dylib" libdb2.dylibĮxport DYLD_LIBRARY_PATH="venv/lib/$py_folder/site-packages/clidriver/lib:$DYLD_LIBRARY_PATH"Īfter this, you should successfully be able to connect to DB2 via Python. If test -f "$PWD/clidriver/lib/libdb2.dylib" then Install_name_tool -change libdb2.dylib "$(pwd)/clidriver/lib/libdb2.dylib" "$db2_binary" # Only need to execute this when running on macĭb2_binary=$(ls ibm_db.cpython* | head -n 1) ![]() If you don’t do this, the below script won’t work # Create the virtual environment in your project folder ![]() # Double check this is the python version you're wanting to use I primarily use Pycharm IDE, so isolating this issue to a virtual environment made it easier to fix for me. Make sure you’re using a virtual environment.Source ~/.bashrc # If bash is your default shell Source ~/.zshrc # If zsh is your default shell # Example: brew install install Add the installed Python brew to your PATHĮcho 'export > ~/.zshrc # If zsh is your default shellĮcho 'export > ~/.bashrc # If bash is your default shell Doing so allows give you a more standard location for the Python3.x executable Here are the steps I used to solve this problem: Referenced from: venv/lib/python3.7/site-packages/ibm_db.cpython-37m-darwin.so Reason: image not foundĪfter hours and even days of Googling, I finally compiled a number of Github issues and Stack overflow posts to come to the solution to this problem.Ĭonnecting to IBM DB2 on MacOS (Intel) with Python If you’ve tried to connect to a DB2 database using the ibm-db package, you might have run into this issue at some point: ImportError: dlopen(venv/lib/python3.7/site-packages/ibm_db.cpython-37m-darwin.so, 2): Library not loaded: libdb2.dylib ![]() Update (): I've updated these instructions to also handle issues with Macbooks using the M1 / Apple Silicon chip ![]()
0 Comments
Leave a Reply. |