首页 > 系统相关 >python3.10在centos7上构建

python3.10在centos7上构建

时间:2023-01-20 17:00:53浏览次数:55  
标签:python3.10 -- openssl devel centos7 Python 构建 install

概述

在centos7上安装py3.10,用到openssl库

env

  • centos7.8
  • Python-3.10.7.tgz

link

01 下载Python3.10.7

02 requirement

yum install -y gcc gcc-c++ make autoconf

yum insall -y zlib-devel bzip2-devel ncurses-devel sqlite-devel readline-devel  libffi-devel

require openssl-1.1.1+,需要自编译

03 install openssl

./config -fPIC --prefix=/usr/local/openssl
make -s -j4
make -s install -j4

注释:
--prefix:指定安装目录
-fPIC:编译openssl的静态库

04 building-py

tar zxf Python-3.10.7.tgz   && cd Python-3.10.7


//view configure help
./configure --help
...
  --with-system-ffi       build _ctypes module using an installed ffi library,
                          see Doc/library/ctypes.rst (default is
                          system-dependent)
...
  --with-openssl=DIR      root of the OpenSSL directory
  --with-openssl-rpath=[DIR|auto|no]
                          Set runtime library directory (rpath) for OpenSSL
                          libraries, no (default): don't set rpath, auto:
                          auto-detect rpath from --with-openssl and

//编译过程提示错误,因此需要安装openssl-1.1.1+
Failed to build these modules:
_hashlib              _ssl                                     

Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

//编译构建
./configure -q --prefix=/usr/local/python3.10.7 --with-openssl=/usr/local/openssl --with-openssl-rpath=auto

make -s -j4  && make -s -j4 install

py3.10.7/lib/python3.10/site-packages  ## pip安装的包路径
py3.10.7/bin/xxx   //部分whl安装后可执行文件会在这里存在

04 env && yum

vim /etc/profile
export PATH=/usr/local/python3.10.7/bin:$PATH
source /etc/profile

//struct
bin
include
lib
share

bin/   #原生的Python,默认的Python还是Python 2.7.5

#调用Python
#!/usr/bin/env python3.10

error

//error
zipimport.ZipImportError: can't decompress data; zlib not available
cd Modules/zlib
./configure
make install  //缺少则编译
or
yum install -y zlib-devel

apt-get install zlib1g-dev   //ubuntu16.04

//ModuleNotFoundError: No module named '_ctypes'
01 install libffi-devel
02 enable openssl and version
03 again buiding py3.10

标签:python3.10,--,openssl,devel,centos7,Python,构建,install
From: https://www.cnblogs.com/xiaochina/p/17019564.html

相关文章

  • 42-Springboot整合HignLevelClient----构建复杂检索
    @Test voidsearchTest()throwsIOException{ SearchRequestsearchRequest=newSearchRequest(); //1、指定索引 searchRequest.indices("bank"); //2.1、......
  • Python-构建自适应线性神经元
    Python-构建自适应线性神经元1自适应线性神经元自适应性神经元(Adaline)可以视为感知器的优化和改进。该算法说明了定义最小化连续性代价函数的关键概念。这为理解如逻辑......
  • 微信小程序开发工具不能构建npm的解决方法
    在控制台输入初始化命令:npminit在输入命令之后一直点回车然后输入命令:npmiminiprogram-sm-crypto--production最后再去微信开发者工具中点击:工具->构建npm,就能成......
  • centos7.8 安装单实例oracle数据库
    目录centos7.8安装单实例oracle数据库前置操作禁用TransparentHugePages安装rlwrap安装操作安装后配置修改数据存放路径(可选)其它操作oracle安装脚本执行数据库启动、......
  • centos7.9离线安装mysql5.7.40(本文使用mysql_install_db安装方法)
    centos7.9离线安装mysql5.7.40(本文使用mysql_install_db安装方法)一、卸载CentOS7系统自带mariadb#查看系统自带的Mariadb[root@NIWAY-190~]#rpm-qa|grepmariadbmari......
  • CentOs7安装goland
    下载与安装#创建安装位置与工作空间mkdir-p/opt/goland&&mkdir-p/opt/goland/work_space#下载go到用户家目录cd&&wgethttps://golang.google.cn/dl/go1......
  • mysql主(云服务器centos7)从(本地win10)搭建失败记录【reggie_take_out】
    mysql集群结构主库(云服务器centos7)配置[Err]1055-Expression#1ofORDERBYclauseisnotinGROUPBYclauseandcontainsnonaggregatedcolumn'informat......
  • 前端开发与构建工具Vite
    vite的特性vite主要由两部分组成:一个开发服务器,它基于原生ES模块提供了丰富的内建功能,如速度快到惊人的模块热更新(HMR)。一套构建指令,它使用Rollup打包你的代码,并且......
  • 使用Gradle构建Java项目
    引入springboot插件该插件发布在Gradle的插件门户网站上,可以使用插件块来应用:plugins{id'org.springframework.boot'version'2.3.7.RELEASE'//维护springboot......
  • CentOS7下配置使用JumpServer 堡垒机 (图文教程)
    前面介绍了如何在《CentOS7下搭建JumpServer堡垒机》,基于这篇文章的环境搭建过程,接着介绍安装后的的功能配置使用。首次wbe登录,https://ip:80,默认账号密码:admin,admin;这......