Archive for the ‘OSX’ Category

python interface for libsvm on Leopard with default python

/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python <==origin python modified Makefile ============================ CXX? = g++ SWIG ?= swig #Windows: see ../README ../Makefile.win PYTHON_INCLUDEDIR ?= /System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/ CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I.. #LDFLAGS = -shared # Mac OS LDFLAGS = -framework Python -bundle all: svmc.so svmc.so: svmc_wrap.o svm.o $(CXX) $(LDFLAGS) -o svmc.so svmc_wrap.o svm.o svmc_wrap.o: svmc_wrap.c ../svm.h $(CXX) $(CFLAGS) -fPIC -c svmc_wrap.c svmc_wrap.c: [...]

Continue reading »

PyQT Installation on OSX

$ sudo port install python25 $ sudo port install python_select$ sudo python_select python25$ sudo port install py25-macholib-devel$ sudo port install py25-sip$ sudo port install py25-pyqt4$ sudo port install py25-py2app-devel$ sudo port install py25-pyqt # install eric4 u need QScintilla2 $ cd QScintilla  $ cd Qt4  $ qmake-mac qscintilla.pro -spec macx-g++  make  sudo make install  #Python wrapper [...]

Continue reading »

Command Alias

$ sudo cp .bashrc .bashrc.bak # backup $ sudo nano .bashrc # ubuntu $ sudo nano .bash_profile # mac add the following: alias imac=’$ ssh user@ip -p 1234′ alias py3=’/opt/local/Library/Frameworks/Python.framework/Versions/3.0/bin/python3.0′

Continue reading »

Remove macports completely

% sudo rm -rf  the following folders /opt/local  /Applications/MacPorts  /Library/Tcl/macports1.0  /Library/LaunchDaemons/org.macports.*  /Library/StartupItems/DarwinPortsStartup

Continue reading »

Matplot installation and examples

Source Note: After installation, you have to set the backend of matplot First, change the permission by sudo chmod +w, and then edit the file by nano. /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc Finally, select the backend as TkAgg Example: import pylab as plt a = plt.randn(10000) plt.hist(a,100)

Continue reading »

Change the bash prompt

$ nano .bash_profile # set prompt: “username@hostname:/directory $ ” PS1=”\u@\h:\w “ case `id -u` in      0) PS1=”${PS1}# “;;      *) PS1=”${PS1}$ “;;esac $ sudo scutil –set HostName mb

Continue reading »

Follow

Get every new post delivered to your Inbox.