Unable to get ibm_db up and working on Maverick

431 views Asked by At

I am trying to get ibm_db up and working on OSX Mavericks. I am following the directions found in the DB2 for MAC OS X and was able finish them successfully.

However, there is nothing in there for setting the environment variables: I know I need to add this line: export IBM_DB_HOME=/Users/db2inst1/sqllib to a file somewhere. What file is it? I have tried sudo vi /etc/launchd.conf and when I go to easy_install ibm_db I am getting the following error:

Environment variable IBM_DB_HOME is not set. Set it to your DB2/IBM_Data_Server_Driver installation directory and retry ibm_db module install.
No eggs found in /var/folders/_z/2nmsjtjj23jdqb6tn0l2v6g0lc16cd/T/easy_install-HjFtty/ibm_db-2.0.5/egg-dist-tmp-omhhih (setup script problem?)

I feel like I am really close

2

There are 2 answers

0
DarthOpto On BEST ANSWER

I found that I needed to edit ~./bash_profile and put my IBM_DB_HOME in there. This took care of the problem and I was able to successfully install the python ibm_db package.

0
Lucas Isaac On

How to make ibm_db work on MAC

Make sure that you has IBM DB2 EXPRESS 2 installed on your machine: https://www.ibm.com/analytics/us/en/db2/trials/?S_CMP=ECDDWW01&S_TACT=ACDB201

To install the DB2 EXPRESS 2 extact the files into your computer and:

cd ~/Downloads/expc ; sudo ./db2_install

Make sure that you has your $HOSTNAME variable properly configured:

echo "127.0.0.1 $HOSTNAME" >>/etc/hosts

Create another user using mac gui (System Preferences -> Users & Groups). Use Standard (Non-Admin) privileges.

Create the instance with these commands:

cd /opt/IBM/db2/V10.1/instance ; sudo ./db2icrt -u <newuser> <newuser>

Export the following variables

$ sudo -s
$ export IBM_DB_LIB=/Users/<username>/sqllib/lib64
$ export IBM_DB_DIR=/Users/<username>/sqllib
$ export ARCHFLAGS="-arch x86_64"

Intall ibm_db

pip3 install ibm_db