2012年4月11日

在mac上安裝python 2.7環境

1. Install python 2.7
2. link to current

cd /Library/Frameworks/Python.framework/Versions/ ln -s 2.7 Current

3. Switch /usr/bin/python to link to current python

cd /usr/bin mv python python-backup sudo ln -s /Library/Frameworks/Python.framework/Versions/Current/bin/python python

4. Download python egg from http://pypi.python.org/pypi/setuptools#files and install

sudo sh /Users/sushih-wen/Downloads/setuptools-0.6c11-py2.7.egg sudo easy_install pip

5. Install Virtualenv

pip --version sudo pip install virtualenv

6. Run virtualenv for your project

cd /myproject virtualenv venv --python=python2.7 . /venv/bin/activate #leave venv with $deactivate

7. Install your packages

pip install flask

沒有留言:

張貼留言