安装:
xcode
iterm
go2shell
oh my zsh
homebrew
安装 pip:
sudo easy_install pip
安装python虚拟环境:
sudo pip install virtualenv
sudo pip install virtualenvwrapper
vim ~/.zshrc
# 存放虚拟环境的目录
export WORKON_HOME=~/.virtualenv
# virtrualenvwrapper会安装到python的bin目录下,
# 所以该路径是python安装目录下bin/virtualenvwrapper.sh
source /usr/local/bin/virtualenvwrapper.sh
创建虚拟环境
mkvirtualenv env
安装 mysql 和 mysqlclient 和 mysql-connector-c
brew install mysql mysql-connector-c
pip install mysqlclient
可能出现 not found mysql_config
参见:
https://github.com/PyMySQL/mysqlclient-python
做完后可能会出现:
ld: library not found for -lssl
可以这样解决:
brew install openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
安装 redis
brew install redis
pip install python-redis
启动 mysql:
mysql.server start
设置mysql密码:
mysql_secure_installation