新服务器配置

笔记

更新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
遇到的错误
  1. 如果遇到以下错误:

    Traceback (most recent call last):
      File "/usr/bin/pip", line 9, in <module>
        from pip import main
    ImportError: cannot import name main

    将上面代码换成:

    from pip import __main__
    if __name__ == '__main__':
        sys.exit(__main__._main())
  2. 在pip 安装MySQL-python 会遇到以下错误

    Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-install-qI3fAK/MySQL-python/setup.py", line 17, in <module>
            metadata, options = get_config()
          File "setup_posix.py", line 43, in get_config
            libs = mysql_config("libs_r")
          File "setup_posix.py", line 25, in mysql_config
            raise EnvironmentError("%s not found" % (mysql_config.path,))
        EnvironmentError: mysql_config not found
    

    只需要提前安装下:

    sudo apt-get install libmysqlclient-dev
  3. 遇到下面问题:

     Warning: (1287L, 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

  4. gunicorn问题:

        查看gunicorn进程
        pstree -ap|grep gunicorn
        重启gunicorn
        kill -HUP 30080(进程ID)

    如果没有pstree命令

    sudo apt-get install psmisc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值