

Similar to the Intel instructions, virtual environments help isolate packages between projects
VSCODE PYTHON MAC M1 INSTALL

# 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
VSCODE PYTHON MAC M1 UPDATE
Update (): I've updated these instructions to also handle issues with Macbooks using the M1 / Apple Silicon chip
