筆記
更新apt-get:
- sudo apt-get upgrade
- sudo apt-get update
安裝C編譯(必須):
部分伺服器廠商沒有, 阿裡雲騰訊雲谷歌雲亞馬遜都預裝了
- sudo apt-get install gcc;
- sudp apt-get install g++;
- sudo apt-get install make
安裝python(部分新伺服器沒有)
- sudo apt-get install python2.7
- sudo apt-get install python3.5(目前遇到的伺服器都有3.x版本)
- sudo apt-get install python-pip
- sudo apt-get install python3-pip
- pip install –upgrade pip
遇到的錯誤
- 如果遇到以下錯誤:
将上面代碼換成:Traceback (most recent call last): File "/usr/bin/pip", line , in <module> from pip import main ImportError: cannot import name main
from pip import __main__ if __name__ == '__main__': sys.exit(__main__._main())
- 在pip 安裝MySQL-python 會遇到以下錯誤
隻需要提前安裝下:Traceback (most recent call last): File "<string>", line , in <module> File "/tmp/pip-install-qI3fAK/MySQL-python/setup.py", line , in <module> metadata, options = get_config() File "setup_posix.py", line , in get_config libs = mysql_config("libs_r") File "setup_posix.py", line , in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found
- 遇到下面問題:
Warning: (, u"'@@tx_isolation' is deprecated and will be removed in a future release. Please use'@@transaction_isolation' instead") cursor.execute('SELECT @@tx_isolation')
代碼位址: https://github.com/zzzeek/sqlalchemy/pull/391/files新伺服器配置筆記 - gunicorn問題:
如果沒有pstree指令檢視gunicorn程序 pstree -ap|grep gunicorn 重新開機gunicorn kill -HUP (程序ID)
sudo apt-get install psmisc