linu下python3安装

部署步骤参考:https://www.cnblogs.com/kimyeee/p/7250560.html
问题
1、wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz执行不通,域名无法解析:
vim /etc/hosts
在最后添加151.101.72.223 www.python.org
执行:wget https://151.101.72.223/ftp/python/3.6.1/Python-3.6.1.tgz
2、make遇错误:
错误问题:make: *** [pybuilddir.txt] 错误 1
解决方法:
在 ./configure 操作前,先进行配置
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN.UTF-8
3、
pip3 install 第三方库遇到错误:
错误问题:
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb9050>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb9190>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb92d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb9410>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f74f8bb9550>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/pip/
Could not find a version that satisfies the requirement ** (from versions: ) 
No matching distribution found for simpejson
解决方法:
以上问题发现原来是DNS配置错误,域名服务器地址是本机IP地址,127.0.0.1,所以修改域名服务器
vim /etc/resolv.conf 
在文件最后添加:
nameserver  8.8.8.8
4、再次 pip3 install 第三方库遇到问题:
错误问题:
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/local/python3/lib/python3.6/site-packages
You are using pip version 8.0.2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
解决方法:
pip3 install --upgrade pip
5、import lightgbm遇到问题:
错误问题:
OSError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/python3/lib/python3.6/site-packages/lightgbm/lib_lightgbm.so)
解决方法:

参考:https://www.cnblogs.com/wangxiaoqiangs/p/7170922.html

同事整理mark

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值