如何在已安装Python解释器的Linux上更新Python
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
链接:https://blog.csdn.net/little_stupid_child/article/details/82747227
问题
)
# CD /usr/bin
# sudo rm python2
# make
make install 或者 make && make install
#sudo ln -s /usr/local/python3/bin/python3 /usr/bin/python3
# vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/python3/bin
export PATH
按ESC,输入:wq 或者 输入:x 回车退出。
# source ~/.bash_profile
# python3 -V
Python 3.6.8
# pip3 -V
pip 18.0.1 from
/usr/local/python3/lib/python3.6/site-packages (python 3.6)
# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
注:
[root@localhost ~]# python2.7.5
Python 2.7.5 (default, Jun 3 2013, 11:08:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/python27/lib/python2.7/ssl.py", line 60, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
>>>
vim /root/Python-3.6.5/Modules/Setup.dist
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
./configure --prefix=/usr/local/python
make
make install
[root@localhost ~]# python
Python 3.6.4 (default, Jun 3 2013, 14:56:13)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>>
如何在已安装Python解释器的Linux上更新Python的更多相关文章
- 【Azure 应用服务】Azure App Service For Linux 上实现 Python Flask Web Socket 项目 Http/Https
问题描述 在上篇博文"[Azure 应用服务]App Service for Linux 中实现 WebSocket 功能 (Python SocketIO)"中,实现了通过 HT ...
- linux下更新python
刚开始入门python,想直接入门python3,需要更新一下linux自带的python.自带的python是2.6,可以在终端root下键入python查看python版本. 1.从官网下载pyt ...
- 服务器(Linux)上运行python总结
跑实验换了几次服务器了,每次遇到相似问题都要重新百度,而且每次百度搜索出的顺序都不一样,又得重新找半天,这次把遇到的问题都总结一下. 1.准备 PuTTY和FileZilla FileZilla使用F ...
- Python脚本:Linux自动化执行Python脚本
1.环境及其工具: ubuntu 16.04 python2.7(自带) pip2.7(安装) virtualenv(安装) crontab (自带) 2.pip2.7安装 (1)尝试使用 sudo ...
- 【安装】Mysql在Linux上安装
1.下载 下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads 下载版本:mysql-5.6.37-linux-glibc2.12- ...
- 安装ORACLE时在Linux上设置内核参数的含义
前两天看到一篇Redhat官方的Oracle安装文档,对于Linux内核参数的修改描述的非常清晰. 安装Oracle之前,除了检查操作系统的硬件和软件是否满足安装需要之外,一个重点就是修改内核参数,其 ...
- python 1: 解决linux系统下python中的matplotlib模块内的pyplot输出图片不能显示中文的问题
问题: 我在ubuntu14.04下用python中的matplotlib模块内的pyplot输出图片不能显示中文,怎么解决呢? 解决: 1.指定默认编码为UTF-8: 在python代码开头加入如下 ...
- 02——Solr学习之Solr安装与配置(linux上的安装)
借鉴博客:https://www.jianshu.com/p/1100f54fcbd8 https://www.cnblogs.com/jepson6669/p/9134652.html 1.准备一个 ...
- Python request 在linux上持续并发发送HTTP请求遇到 Failed to establish a new connection: [Errno 11] Resource temporarily unavailable
并发数被限制 vim /etc/sysctl.conf 添加 net.ipv4.ip_local_port_range = 1024 65535 保存 /sbin/sysctl -p 让修改生效 ...
随机推荐
- echars 图表提示框自定义显示
一 . 显示单条数据时在tooltip里调用formatter函数给自定义提示框内数据. 效果图显示 二 . 当显示多条数据时.为保证和原来的效果相同需要自己实现点的效果.如果不实现,提示框则不限点的 ...
- Analysis of Servlet
@WebServlet("/cdiservlet") public class NewServlet extends HttpServlet { private Message m ...
- Tomcat配置https协议访问
Tomcat9配置https协议访问: https://blog.csdn.net/weixin_42273374/article/details/81010203 配置Tomcat使用https协议 ...
- gson 入门使用
参考文章:https://www.cnblogs.com/majay/p/6336918.html Java 对象与 Json 之间的互相转换,用的比较多大是 Jackson 与 Gson 第一步:添 ...
- BurpSuite抓HTTPS包
Burp Suite要抓HTTPS的包的话,是需要有Burp Suite的CA证书的 为什么要证书这里就不说了,下面是具体步骤 1.首先要把Burp Suite的CA证书下载到本地 Burp Suit ...
- 一些matlab命令
expand: R = exprnd(MU) returns an array of random numbers chosen from the exponential distribution w ...
- 命令行连WiFi
命令行连WiFi sudo iw dev wlan0 scan |grep SSID wpa_cli -iwlan0 add_network wpa_cli -iwlan0 set_network 4 ...
- celery 应用
开启服务 #日志 级别 celery -A write_file worker -l info file name :write_file.pyfrom celery import Celery ce ...
- layui与echarts
https://pan.baidu.com/s/1qM5ybqD-wAQNnWubdegBiA 在此感谢Layui给我这种不懂前端的人很大的帮助
- Mybatis order by语句使用<Choose><When>动态拼装无效的原因及解决方法
在使用 <choose> <when test=""> </when> <otherwise> </otherwise> ...