zoukankan      html  css  js  c++  java
  • python——平时遇到问题记录

    # pyhs2安装

    #centos
    yum install groupinstall 'development tools'
    yum install python34-devel
    yum install libevent-devel
    pip install gevent
    yum install cyrus-sasl-plain  cyrus-sasl-devel  cyrus-sasl-gssapi
    pip install pyhs2
    pip install thrift-sasl==0.2.1
    
    #ubuntu
    apt install sasl2-bin libsasl2-2 libsasl2-dev
    pip install gevent
    pip install thrift-sasl==0.2.1
    pip install pyhs2

    # 安装tensorflow时报Cannot uninstall wrapt

    pip install -U --ignore-installed wrapt enum34 simplejson netaddr

    # import matplotlib时报缺少Libgl.so.1

    yum install libglvnd
    或者
    yum install mesa-libGL

    # 安装psycopg2时报错,Command "python setup.py egg_info" failed with error code 1

    yum install python-devel postgresql-devel

    # gcc或者g++报错

    yum install gcc gcc-c++

    # Can't connect to HTTPS URL because the SSL module is not available

    1. 使用anaconda的虚拟环境时
    由于anaconda的使用的是自带的ssl模块,而不使用系统的openssl库,需要复制libcrypto.so和libssl.so两个动态链接库到虚拟环境的lib目录下
    2. 使用编译python环境
    编译前
    yum install libffi-devel    # 有这个才能编译出_ctypes模块
    yum install openssl openssl-devel   # 有这个才能编译出ssl功能 
    openssl version    # 确认版本1.0.2及以上
    
    编译
    ./configure --prefix=/usr/local/python3 --with-ssl
    make -j4    #使用4核CPU编译
    make install
  • 相关阅读:
    python基础——反射
    python基础——模块
    python基础——异常处理、递归
    python基础——生成器与迭代器
    python基础——装饰器
    Python常见面试题
    Socket网络编程
    爬虫解析相关
    爬虫请求相关
    初识爬虫
  • 原文地址:https://www.cnblogs.com/maxgongzuo/p/12886789.html
Copyright © 2011-2022 走看看