美文网首页
python日常使用问题1

python日常使用问题1

作者: 狗狗胖妞 | 来源:发表于2019-08-12 17:57 被阅读0次

    Python3 安装后SSL问题解决办法

    参考文档: https://blog.csdn.net/u013427969/article/details/67648207

    • python3可能用到的依赖: openssl-dev libffi-devel
    • 修改Moudles/Setup

    解决安装python3后yum不能使用的问题

    **参考文档: https://www.cnblogs.com/YCcc/p/11077456.html
    **

    #修改如下文件
    # vim /usr/bin/yum
    # vi /usr/libexec/urlgrabber-ext-down  //如果存在
    

    无网络环境安装python模块

    #已安装的模块名称导出到文件
    pip freeze >requirements.txt
     
    #导出已安装的模块到文件夹,指定模块名称或导出所有已安装的模块
    pip3 download  -d dir_name  elasticsearch           //指定一个模块名导出
    pip3 download  -d dir_name  -r requirements.txt  // 指定多个模块名文件导出
     
    #在无网络的机器上安装已导出的模块,指定模块名称或指定包含所有模块列表的文件
    pip install --no-index --find-links=dir_name -r requirements
    pip install --no-index --find-links=dir_name elasticsearch
     
    #如发生错误Fatal error in launcher,用如下命令
    python -m pip install --no-index --find-links=dir_name elasticsearch
    

    pip安装时ReadTimeoutError解决办法

    参考文档: https://www.jianshu.com/p/3378fa827924

    pip --default-timeout=100 install gevent
    

    sqlalchemy设置字段的默认值

    参考文档: https://www.jianshu.com/p/6d3ec5851f3a

    class Host(Base):
            __tablename__ = 'host'
            id = Column(Integer, primary_key=True, autoincrement=True)
            ip = Column(String(15), nullable=False)
            ssh_port = Column(SmallInteger, server_default='22', nullable=False)
            group_id = Column(Integer, ForeignKey('host_group.id'), nullable=False)
            host_group = relationship(Host_Group, backref='host')
            description = Column(String(32))
    

    相关文章

      网友评论

          本文标题:python日常使用问题1

          本文链接:https://www.haomeiwen.com/subject/ducisftx.html